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

Skip to content

Commit 828a499

Browse files
committed
upload homepage
1 parent 27b05ff commit 828a499

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

week1/homework/src/server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ function createServer(port) {
1414
const server = http.createServer((request, response) => {
1515
console.log(request.method, request.url);
1616
switch (request.url){
17+
case '/':
18+
response.writeHead(200, {'Content-Type': 'text/html'});
19+
response.end('<!doctype html><html><head></head><body>Hello Hack Your Future</body></html>');
1720
case '/state':
1821
response.writeHead(200, {'Content-Type': 'application/json'});
1922
response.end(JSON.stringify( {state: state}));
@@ -54,4 +57,3 @@ module.exports = {
5457

5558

5659

57-

0 commit comments

Comments
 (0)