diff options
author | Mateja <mail@matejamaric.com> | 2021-05-02 13:56:53 +0200 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2021-05-02 13:56:53 +0200 |
commit | d5a7f3cad8ed4cd4ac972c86e4d6364c7731c69d (patch) | |
tree | 4684f477927f05b5ad0531c4c9ed6b1b594229b4 /index.js | |
download | node-playground-d5a7f3cad8ed4cd4ac972c86e4d6364c7731c69d.tar.gz node-playground-d5a7f3cad8ed4cd4ac972c86e4d6364c7731c69d.zip |
Simplest Node.js web server.
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 8 |
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.')); |