node -v
npm -v
install EXPRESS framework
https://expressjs.com/en/starter/generator.html
$ npm install -g express-generator
express -h
express --view=ejs
express --no-view Demo1
Go inside the Demo1 folder and type "code .", it'll open Project in VSCode
npm install(installs packages)
set DEBUG=demo1:*
npm start ==> project starts running in localhost:3000
callback function==> passing fn as argument
morgan ==> is the logger
npm install nodemon
npm start
go to package.json file and change the following line
{
"name": "demo1",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
change to
{
"name": "demo1",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "nodemon ./bin/www"
},
goto app.js and comment the line
//app.use(express.static(path.join(__dirname, 'public')));
goto routes/index.js and change to
router.get('/', function(req, res, next) {
res.send({ title: 'Express' });
});
==> vvvvvi, this will write everything on the html page, every code written
truncate vs delete in dbms middleware concept in node.js
to send data using post method, we need to use postman
delete every folder except only 3 files app.js package-lock.json package.json
- array crud
- what is node.js
- what are different http methods and its status code like 404
- get vs post
- var, let vs const
- normal fn vs arrow fn
- repl, how to create server
9595986033
Audumbar Kabade (best teacher)
steps to create project
- go to D drive, open cmd
express --no-view project
cd project
npm i
set DEBUG=project:*
express validator
install bcrypt for encrypting passwords
Sequelize: is a Node. js-based Object Relational Mapper that makes it easy to work with MySQL, MariaDB, SQLite, PostgreSQL databases, and more. An Object Relational Mapper performs functions like handling database records by representing the data as objects.
Multar: is a node middleware for handling multipart/form-data , which is primarily used for uploading files.
Nodemailer: for sending emails