-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
27 lines (27 loc) · 798 Bytes
/
app.js
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
/*const { readFileSync } = require('fs');
const http = require('http');
const server = http.createServer((req,res)=>{
console.log(req.url)
if(req.url==="/"){
res.writeHead(200,{'content-type':'text/html'});
res.write(readFileSync('./html/index.html'))
res.end();
}
else if(req.url==="/css/index.css"){
res.writeHead(200,{'content-type':'text/css'});
res.write(readFileSync('./css/index.css'))
res.end();
}
else if(req.url==="/about"){
res.writeHead(200,{'content-type':'text/html'});
res.write(readFileSync('./html/about.html'))
res.end();
}
else{
res.writeHead(404,{'content-type':'text/html'})
res.write('<h1>not founf</h1>')
res.end()
}
})
server.listen(5000);
*/