aboutsummaryrefslogtreecommitdiff
path: root/practice/index.js
diff options
context:
space:
mode:
authorIbrahim Mkusa <ibrahimmkusa@gmail.com>2023-05-03 23:52:12 -0400
committerIbrahim Mkusa <ibrahimmkusa@gmail.com>2023-05-03 23:52:12 -0400
commit62215dfc4c2b8e96524057197c1e122b258d3cc2 (patch)
tree4b75f80c04e3ac6f47c4e7ebbb5866409e058cb8 /practice/index.js
parent6610ee7aec692cd5c913a2853f16d3f1030c19bf (diff)
plain webserver using vanilla v8
Diffstat (limited to 'practice/index.js')
-rw-r--r--practice/index.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/practice/index.js b/practice/index.js
new file mode 100644
index 0000000..c916bed
--- /dev/null
+++ b/practice/index.js
@@ -0,0 +1,10 @@
+const http = require('http')
+
+const app = http.createServer((request, response) => {
+ response.writeHead(200, { 'Content-Type': 'text/plain' })
+ response.end('Habari Tanzania')
+})
+
+const PORT = 3001
+app.listen(PORT)
+console.log(`Server running on port ${PORT}`)