Skip to content

Commit 114b831

Browse files
committed
Fix errors
1 parent 07ed998 commit 114b831

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

JavaScript/1-HTTP/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const cacheFile = name => {
2222
const method = require(filePath);
2323
api.set(key, method);
2424
} catch (e) {
25-
cache.delete(name);
25+
api.delete(name);
2626
}
2727
};
2828

@@ -48,7 +48,7 @@ setTimeout(() => {
4848

4949
http.createServer(async (req, res) => {
5050
const url = req.url === '/' ? '/index.html' : req.url;
51-
const [s, folder, file] = url.split('/');
51+
const [, folder, file] = url.split('/');
5252
if (folder === 'api') {
5353
const method = api.get(file);
5454
const body = [];

0 commit comments

Comments
 (0)