From d5a7f3cad8ed4cd4ac972c86e4d6364c7731c69d Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 2 May 2021 13:56:53 +0200 Subject: Simplest Node.js web server. --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 index.js (limited to 'index.js') diff --git a/index.js b/index.js new file mode 100644 index 0000000..6ea86da --- /dev/null +++ b/index.js @@ -0,0 +1,8 @@ +const http = require('http'); + +http.createServer((req, res) => { + + res.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'}); + res.end('

lol

'); + +}).listen(8080, () => console.log('Server started on port 8080.')); -- cgit v1.2.3