Web Backend Development With ExpressJS (Beta version)
Things to install:
- node.js
node -v
- express.js
npm i express
- nodemon
npm i nodemon -D
- download postman
- download git bash
- install nodejs (LTS version), on terminal check if its installed
node -v
. - create a new folder. open terminal, type
npm init -y
created package.json file. - create new file server.js for all the backend codes here.
- in package.json, add
"serve": "node server.js"
under the"scripts"
. - install express
npm i express
and node_modules folder appeared. - inside server.js file, put recommended expressjs codes to have access to the server.
- on terminal, type
npm run serve
opens up the server.js file. - interact node api app with Postman or Insomnia.
- install git to track codes. on terminal, type
git init
and color changed green. - add
.gitignore
file and put node_modules folder inside it so color changed gray. - on terminal, type
git add.
to add all files. - then, type
git commit -m "msg description"
to save the files. - install nodemon
npm i nodemon -D
as a dev dependency. - on package.json, add
"dev": "nodemon server.js"
to run nodemon with server.js under"scripts"
. - on terminal, type
npm run dev
to open server.js with nodemon.