This commit is contained in:
parent
0e55b154ed
commit
779e7e1478
@ -4,7 +4,7 @@ import promiseMiddleware from "../../helper/promiseMiddleware";
|
|||||||
type RH = (req: Request, res: Response, next?: NextFunction) => any;
|
type RH = (req: Request, res: Response, next?: NextFunction) => any;
|
||||||
|
|
||||||
function call(handler: RH, req: Request, res: Response) {
|
function call(handler: RH, req: Request, res: Response) {
|
||||||
return new Promise((yes, no) => {
|
return new Promise<void>((yes, no) => {
|
||||||
let p = handler(req, res, (err) => {
|
let p = handler(req, res, (err) => {
|
||||||
if (err) no(err);
|
if (err) no(err);
|
||||||
else yes();
|
else yes();
|
||||||
|
@ -63,7 +63,9 @@ export default class Web {
|
|||||||
let m = req.method;
|
let m = req.method;
|
||||||
while (m.length < 4) m += " ";
|
while (m.length < 4) m += " ";
|
||||||
Logging.log(
|
Logging.log(
|
||||||
`${m} ${req.originalUrl} ${req.language} ${resColor}${res.statusCode}\x1b[0m - ${time}ms`
|
`${m} ${req.originalUrl} ${
|
||||||
|
(req as any).language || ""
|
||||||
|
} ${resColor}${res.statusCode}\x1b[0m - ${time}ms`
|
||||||
);
|
);
|
||||||
res.removeListener("finish", listener);
|
res.removeListener("finish", listener);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user