Configure expressJS as backend API


In order to use expressjs as backend api, head over to https://expressjs.com/ a lots
of free docs are available for the same.


Install visual studio code and run the command
npm install express --save
By using express generator we can quickly bootstrap our app development process.
Install using
npm install express-generator -g



As we are focusing on webapi development so we wont make any unnecessary pug files
(previously jade) file as template engine.
Run  below command
express --no-view

It automatically generates us the necessary files for making webapi, below is the project structure
Advantage of using expressjs is  the highly flexible nature in which we can develop our app.
It also accompanies with the ability to have a scalable architecture for application.
Hit npm-install to resolve all dependencies.




Then npm-start





In the next article we shall uncover how to properly structure the project 
https://github.com/sajalblood/EcommerceServer/tree/master/node-express-boilerplate-master

Comments