-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlec 2
40 lines (26 loc) · 850 Bytes
/
lec 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// npm init/npm -y to initailize package.json
// ls-list of files
// node index.js runs the file
// npm run start to run same file by changing script in package.json
// npm install express to install express
// bina nodemon ke baar baar restart karna padhta h
//gitignore is folder to ignore files which dont need to get deployed on github
// Production-
//npm i dotenv
console.log('coffee with satyam');
require('dotenv').config()
const express = require('express')
const app = express()
const port = 4000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.get('/twitter',(req,res)=>{
res.send('Anonymous rkhna pasand karunga')
})
// app.listen(port, () => {
// console.log(`Example app listening on port ${port}`)
// })
app.listen(process.env.PORT,()=>{
console.log(`Example app listening on port ${port}`)
})