Skip to content

Commit 978197b

Browse files
committed
Fix syntax
1 parent 82241ec commit 978197b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

JavaScript/server.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Client = require('./client.js');
66
const Session = require('./session.js');
77

88
const routing = {
9-
'/': async client => '<h1>welcome to homepage</h1><hr>',
9+
'/': async () => '<h1>welcome to homepage</h1><hr>',
1010
'/start': async client => {
1111
Session.start(client);
1212
return `Session token is: ${client.token}`;
@@ -30,9 +30,9 @@ const routing = {
3030
}),
3131
'/api/method3': async client => {
3232
if (client.session) {
33-
return [...client.session.entries()].map(([key, value]) => {
34-
return `<b>${key}</b>: ${value}<br>`;
35-
}).join();
33+
return [...client.session.entries()]
34+
.map(([key, value]) => `<b>${key}</b>: ${value}<br>`)
35+
.join();
3636
}
3737
return 'No session found';
3838
},
@@ -64,6 +64,7 @@ http.createServer(async (req, res) => {
6464
}, err => {
6565
res.statusCode = 500;
6666
res.end('Internal Server Error 500');
67+
console.log(err);
6768
});
6869
return;
6970
}

0 commit comments

Comments
 (0)