Connect Node.js with CouchDB
Go to C folder. Create a folder name “couchemployees” within an already created folder “projects”.
Open command prompt and go to the location.
Create a file as “app.js”, having the following code:
Now entry point will be app.json
Now use the following command:
npm install express body-parser ejs node-couchdb –save
Execute the following code to start local server :
Now server is started:
Open the local browser: localhost:3000
Edit the app.js file with the following code:
Create a folder “view” and then create a file “index.ejs” within it, having the following code:
Now change in the “app.js” file: