const http =require("http");
const url = require("url");
const fs = require("fs");
http.createServer((req,res)=>{
let pathname= url.parse(req.url).pathname;
if( pathname == "/" ){
fs.readFile("./staic/index.html",(err,result) => {
if(err){
console.log(err);
return
}
res.write(result);
res.end();
})
}else if( pathname== "/login"){
fs.readFile("./staic/login.html",(err,result) => {
if(err){
console.log(err);
return
}
res.write(result);
res.end();
})
}else if(pathname == "/register"){
fs.readFile("./staic/register.html",(err,result) => {
if(err){
console.log(err);
return
}
res.write(result);
res.end();
})
}
}).listen(3000,()=>{
console.log("hello word");
})


