aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-05-02 13:56:53 +0200
committerMateja <mail@matejamaric.com>2021-05-02 13:56:53 +0200
commitd5a7f3cad8ed4cd4ac972c86e4d6364c7731c69d (patch)
tree4684f477927f05b5ad0531c4c9ed6b1b594229b4 /index.js
downloadnode-playground-d5a7f3cad8ed4cd4ac972c86e4d6364c7731c69d.tar.gz
node-playground-d5a7f3cad8ed4cd4ac972c86e4d6364c7731c69d.zip
Simplest Node.js web server.
Diffstat (limited to 'index.js')
-rw-r--r--index.js8
1 files changed, 8 insertions, 0 deletions
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('<h1>lol</h1>');
+
+}).listen(8080, () => console.log('Server started on port 8080.'));