fix: remove default res
This commit is contained in:
parent
5e38740c7b
commit
2393dfe273
@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/package",
|
||||
"name": "@kevisual/router",
|
||||
"version": "0.0.5-alpha-0",
|
||||
"version": "0.0.5-alpha-1",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.js",
|
||||
|
@ -52,11 +52,6 @@ export class SimpleRouter {
|
||||
return handlers.reduce((promiseChain, handler) => promiseChain.then(() => Promise.resolve(handler(req, res))), Promise.resolve());
|
||||
}
|
||||
|
||||
if (!res?.headersSent && res && res?.end) {
|
||||
res.statusCode = 404;
|
||||
res.end('Not Found');
|
||||
} else {
|
||||
console.error('Not Found');
|
||||
}
|
||||
return 'not_found';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user