// 0)create a repo of your project folder in github first
// 1)in your folder open git bash
npm init
// 2)leave description,test command,keywords,author as empty
// 3)But name entry point as
server.js
// 4)go to github and copy url of repo and use that for github repository
URL.git// URL is copied from github
// 5) install Express
npm install --save express
// 5)open your project folder in vs code
// 6)in opened folder create new file server.js with below exact code:
// grab our dependencies
const express = require('express'),
app = express(),
port = process.env.PORT || 8080;
// configure our application
// set the routes
app.get('/', (req, res) => {
res.send('Hello, I am the app!');
});
// start our server
app.listen(port, () => {
console.log(`App listening on http://localhost: ${port}`);
});
// 7)install server(just once run this command not again)
npm install -g nodemon
// 8)Run server
nodemon server.js
****************************
"Hello, I am the app!" should be there on localhost 8080 by now!
NOTE: crudapp is project folder name
1) create folder app inside crudapp
2) create folders controllers,models inside app
3) create file routes.js inside app
4) create file main.controller.js inside controllers
5) create folder public inside crudapp
6) create folder css inside public
7) create file style.css inside css
8) create folder views inside crudapp