Skip to content

Commit a5d4d2d

Browse files
committed
add app
1 parent eb2e229 commit a5d4d2d

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

mywebapp.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const http = require('http');
2+
3+
const hostname = '0.0.0.0';
4+
const port = 3000;
5+
6+
const server = http.createServer((req, res) => {
7+
res.statusCode = 200;
8+
res.setHeader('Content-Type', 'text/plain');
9+
res.end('Hello World');
10+
});
11+
12+
server.listen(port, hostname, () => {
13+
console.log(`Server running at http://${hostname}:${port}/`);
14+
});

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "nodejsApp",
3+
"version": "1.0.0",
4+
"main": "mywebapp.js",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1"
7+
},
8+
"keywords": [],
9+
"author": "",
10+
"license": "ISC",
11+
"description": ""
12+
}

0 commit comments

Comments
 (0)