Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fcd6851

Browse files
committed
Starting point
1 parent 66881e7 commit fcd6851

File tree

6 files changed

+674
-57
lines changed

6 files changed

+674
-57
lines changed

week1/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

week1/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

week1/index.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1 @@
1-
// To run this file: node index.js
2-
// Then in your browser: http://localhost:8080
3-
var http = require('http');
4-
5-
var port = 8080;
6-
7-
var server = http.createServer();
8-
9-
// Start the HTTP server, start listening for requests
10-
server.listen(port, function(error) {
11-
if (error) {
12-
console.log(error);
13-
} else {
14-
console.log('api listening on port', port);
15-
}
16-
});
17-
18-
// Create a event handler for "request"
19-
// this is an alternative way
20-
server.on('request', function(request, response) {
21-
console.log('New http request received', request.url);
22-
response.setHeader('content-type', 'text/html');
23-
response.write('<html><head></head><body><h1>Hello world</h1></body></html>');
24-
response.end();
25-
});
1+
console.log("Hello world")

0 commit comments

Comments
 (0)