You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const http=require("http"),fs=require("fs"),path=require("path"),server=http.createServer(((e,t)=>{let r="."+e.url;"./"===r&&(r="./index.html");const n={".html":"text/html",".css":"text/css",".js":"text/javascript"}[String(path.extname(r)).toLowerCase()]||"application/octet-stream";fs.readFile(r,((e,r)=>{e?"ENOENT"===e.code?(t.writeHead(404),t.end("404 Not Found")):(t.writeHead(500),t.end("500 Internal Server Error")):(t.writeHead(200,{"Content-Type":n}),t.end(r,"utf-8"))}))})),port=3e3;server.listen(3e3,(()=>{console.log("Server running at http://localhost:3000/")}));