Skip to content

Commit 4937faf

Browse files
committed
Fix code style
1 parent dc06546 commit 4937faf

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

JavaScript/3-http.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ const types = {
1919
undefined: () => 'not found',
2020
};
2121

22-
http.createServer(async (req, res) => {
23-
const handler = routing[req.url];
24-
if (!handler) {
25-
res.end('Handler not found');
26-
return;
27-
}
28-
const data = await handler(req, res);
29-
const type = typeof data;
30-
const serializer = types[type];
31-
const result = serializer(data);
32-
res.end(result);
33-
}).listen(port);
22+
http
23+
.createServer(async (req, res) => {
24+
const handler = routing[req.url];
25+
if (!handler) {
26+
res.end('Handler not found');
27+
return;
28+
}
29+
const data = await handler(req, res);
30+
const type = typeof data;
31+
const serializer = types[type];
32+
const result = serializer(data);
33+
res.end(result);
34+
})
35+
.listen(port);

0 commit comments

Comments
 (0)