-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.js
More file actions
45 lines (32 loc) · 811 Bytes
/
Copy pathNode.js
File metadata and controls
45 lines (32 loc) · 811 Bytes
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
41
42
43
44
45
// const fs=require('fs');
// fs.readFile("sample.txt","utf-8",(err,data)=>{
// if(err){
// console.log(err);
// return;
// }
// console.log(data);
// })
// fs.writeFile("sample.txt","How are You",(err)=>{
// if(err)throw new Error;
// })
// fs.unlink('sample.txt',(err)=>{
// if(err)throw err;
// })
// const http=require('http');
// const server=http.createServer((req,res)=>{
// res.write("Welcome");
// res.end("brother");
// })
// server.listen(3000,()=>{
// console.log('Server is running on 3000')
// })
const express=require('express');
const app=express();
app.use((req,res,next)=>{
console.log("middleware")
next();
})
app.get('/',(req,res)=>{
console.log("welcome home")
})
app.listen(3000,()=>console.log('server is running'))