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

Skip to content

Commit a4ac008

Browse files
committed
Cleanup
1 parent 942c44e commit a4ac008

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.vscode/launch.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Week 1",
11+
"program": "${workspaceFolder}/week1/src/index.js",
12+
"cwd": "${workspaceFolder}/week1"
13+
},
714
{
815
"type": "node",
916
"request": "launch",

week1/src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const sendOtherPage = require('./responses/sendOtherPage');
88
const sendStyles = require('./responses/sendStyles');
99
const sendText = require('./responses/sendText');
1010

11+
const PORT = 3000;
12+
1113
function handleRequest(request, response) {
1214
console.log(request.method, request.url);
1315

@@ -38,6 +40,6 @@ function handleRequest(request, response) {
3840

3941
const server = http.createServer(handleRequest);
4042

41-
server.listen(3000, () => {
42-
console.log('Server started');
43+
server.listen(PORT, () => {
44+
console.log(`Server started http://localhost:${PORT}`);
4345
});

0 commit comments

Comments
 (0)