1. Edit package.json
"scripts": {
"dev": "node server.js",
"prod": "node server.js",
"build": "next build && next export",
"start": "NODE_ENV=production pm2 start server.js --watch",
"export": "npm run build && next export"
},
const express = require('express');
const next = require('next');
const port = 3661;

const dev = process.env.NODE_ENV !== 'production';
const app =…
  1. Create model:
vim user_model.js=======================code==================
const { Schema, model } = require('mongoose')
//New Schema toiri kori
const userSchema = new Schema({
title:{
type: String,
required: true,
trim: true
},
description: {
type: String,
required: true,
trim: true
}
})
const user_table = model('user_table',userSchema)//create user_tablemodule.exports = user_table
const allController = require('./homeController')
app.get('/show', allController.getAllUser)
const user_model = require('./user_model') // include user_model.jsexports.getAllUser = async (req, res, next) => {
let user_data = await user_model.find()
res.render('show',{user_data})
}
vim show.ejsblog_expressjs/views/show.ejs<table class="table">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Description</th>
<th>Action</th>
</tr>
</thead>
<tbody>

<% for(let p of user_data) { %>
<tr>
<th><%= p.id %></th>
<td><%= p.title %></td>
<td><%= p.description %></td>
<td>
<a class="btn btn-md btn-success">Edit</a>
<a class="btn btn-md btn-danger">Delete</a>
</td>
</tr>
<% } %></tbody>
</table>
var data = {  
'name' : 'Ajeet',
'age' : 23,
'designation' : "Designer"
};
const insert = await blog.insert(data);
res.send(insert);
{"ok": true,"id": "fac88d73661979cea68db9c3c2000a01","rev": "1-86ca9e7c60eee1d5644e846a699579b5"}
  • “ok”: It specifies that the operation is successful.
  • “id”: It…
1. npm init --y //Initialise and Configure Our Project
2. npm install express --save //Install express and other dependencies
3. npm install body-parser --save //body parsing middleware
4. npm install --save-dev nodemon //tool that helps develop node.js based applications by automatically restarting the node application when file changes
5. touch server.js //Here Server Code…

CouchDB is a free and open-source fault-tolerant NoSQL database System maintained by the Apache Software Foundation.

  1. Enabling CouchDB repository:
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -
echo "deb https://apache.bintray.com/couchdb-deb bionic main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install couchdb
  1. Install Nodejs:
version check:
node -v
mkdir blog_expressjs
cd blog_expressjs
npm init -y //Initialise and Configure Our Project
npm i express mongoose morgan
npm i -D nodemon //server restart when some change…

Synchronous Programming :

- এখানে একই সময়ে Program execute হবে line by line.
- যখন কোন Function কে কল করা হবে,
তখন ঐ ফাংশনটি Return না করা পর্যন্ত কিনবা ফাংশনটির কাজ শেষ না হওয়া পর্যন্ত পরবর্তী statement execute হব না।
/* 
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/

@media (min-width: 1281px) {

//CSS

}

/*
##Device = Laptops, Desktops
##Screen = B/w 1025px to 1280px
*/

@media (min-width: 1025px) and (max-width: 1280px) {

//CSS

}

/*
##Device = Tablets, Ipads (portrait)
##Screen = B/w 768px to 1024px
*/

@media (min-width: 768px) and (max-width: 1024px) {

//CSS

}

/*
##Device = Tablets, Ipads (landscape)
##Screen = B/w 768px to 1024px
*/

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

//CSS

}

/*
##Device = Low Resolution Tablets, Mobiles (Landscape)
##Screen = B/w 481px to 767px
*/

@media (min-width: 481px) and (max-width: 767px) {

//CSS

}

/*
##Device = Most of the Smartphones Mobiles (Portrait)
##Screen = B/w 320px to 479px
*/

@media (min-width: 320px) and (max-width: 480px) {

//CSS

}

Safaetul Ahasan

Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store