1) Create an empty folder (optional)
2)Go to : https://expressjs.com/en/starter/gene...
3)Follow all steps in the above link.
4)install nodemon if you want do not want to restart the server.
npm install -g nodemon.
5) By default it runs on port: 3000
6) Now install mysql server to connect it with mysql database.
https://expressjs.com/en/guide/databa...
7) Create a new folder in you project root. for adding database password and login.
8) For now i have created a database from mysql terminal. And create a table in it.
9) Create a new file .env in your project root.
10) For that simply change your database connection file.
11) in order to read your env variable we need new package dotenv.
12) Now add your database file in app.js so that it is accessble
everywhere in project.
13) Create a directory in views called partials. where project header footer and nav links are theres.
14) Html is optional you can take this code from github.
15)to connect with database we need to create a model or write a db query there.
Github account link: https://github.com/khurram7534/expres...
Like Share And Subscribe