Welcome aboard! We are happy you are here and wish you good net-raft!
var http = require('http');
const request = require('request')
var srv = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var form = '';
if(req.method == "GET"){
form = '<!doctype html><html lang="en"><head><meta charset="UTF-8"><script type="text/javascript">function MyChange(){alert("Hello world!");}</script></head><body><button onclick="MyChange()">click</button></body></html>';
res.end(form);
}
});
srv.listen(3000);
console.log("Listening to Port 3000");
The most helpful NODEJS solutions