Node : Simple Web Server
import http from "http";
var server = http.createServer(function (req, res) {
if (req.url == '/') {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write('<html><body><p>SIMPLE WEB SERVER TEST</p></body></html>');
res.end();
} else {
res.end('Invalid Request!');
}
});
server.listen(port);
console.log(`Node.js web server at port ${port} is running..`)