1. Create model:
vim user_model.js

2. Create form:

1. app.js

const allController = require('./homeController')
app.get('/show', allController.getAllUser)

2. homeController.js

const user_model = require('./user_model') // include user_model.js

3. Create Show.ejs file:

vim show.ejs

Insert:

var data = {  
'name' : 'Ajeet',
'age' : 23,
'designation' : "Designer"
};
const insert = await blog.insert(data);

response:

{

The response of CouchDB for this command contains 3 fields:

  • “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:

adding the CouchDB GPG key:

curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -

add the CouchDB repository

echo "deb https://apache.bintray.com/couchdb-deb bionic main" | sudo tee -a /etc/apt/sources.list

2. Installing CouchDB on Ubuntu:

sudo apt update
sudo apt install couchdb

Select OK:

Select standalone:

We are installing CouchDB…

Prerequisite tutorial:

  1. Install Nodejs:
version check:
node -v

2. Install express.js,mongoose,morgan and nodemon

express.js(express js install)

mongoose(mongodb install)

morgan(for show log)

nodemon(server restart when some change occur)

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…
  1. Initialise and Configure Our Project:
npm init --y

2. Install the modules sequelize, body-parser, mysql2, and express.

npm install express sequelize mysql2 body-parser cors --save

Synchronous Programming :

- এখানে একই সময়ে Program execute হবে line by line.
- যখন কোন Function কে কল করা হবে,
তখন ঐ ফাংশনটি Return না করা পর্যন্ত কিনবা ফাংশনটির কাজ শেষ না হওয়া পর্যন্ত পরবর্তী statement execute হব না।

উদাহরণ -

statement 1… execute

Function (); // 1s 2s 3s 4s…. …

/* 
##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

}
navigator.browserDetection= (function(){
var ua= navigator.userAgent, tem,
M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if(/trident/i.test(M[1])){
tem= /\brv[ :]+(\d+)/g.exec(ua) || [];
return 'IE '+(tem[1] || '');
}
if(M[1]=== 'Chrome'){
tem= ua.match(/\b(OPR|Edge)\/(\d+)/);
if(tem!= null) return tem.slice(1).join(' ').replace('OPR', 'Opera');
}
M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
if((tem= ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]);
return M.join(' ');
})();

console.log(navigator.browserDetection); // outputs: `Chrome 92`

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