aboutsummaryrefslogtreecommitdiff
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
parent6610ee7aec692cd5c913a2853f16d3f1030c19bf (diff)
plain webserver using vanilla v8
-rw-r--r--part2/countrydata/README.md2
-rw-r--r--practice/index.js10
-rw-r--r--practice/package.json12
3 files changed, 23 insertions, 1 deletions
diff --git a/part2/countrydata/README.md b/part2/countrydata/README.md
index ceb8e8a..3ba4f09 100644
--- a/part2/countrydata/README.md
+++ b/part2/countrydata/README.md
@@ -4,4 +4,4 @@ pulled from https://restcountries.com/#endpoints-all via its REST API
# Example use
![example use](./example_use.png)
-<img src='./example_use.png' style='border-radius: 5px;'/>
+<!--<img src='./example_use.png' style='border-radius: 5px;'/>-->
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}`)
diff --git a/practice/package.json b/practice/package.json
new file mode 100644
index 0000000..38b18da
--- /dev/null
+++ b/practice/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "funwithnode",
+ "version": "1.0.0",
+ "description": "root to test drive node and expres",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1",
+ "start": "node ./index.js"
+ },
+ "author": "Ibrahim Mkusa",
+ "license": "MIT"
+}