diff options
Diffstat (limited to 'practice')
| -rw-r--r-- | practice/index.js | 10 | ||||
| -rw-r--r-- | practice/package.json | 12 | 
2 files changed, 22 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}`) 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" +} | 
