🐛 fix error handler and asset router

This commit is contained in:
Flam3rboy
2021-09-04 11:23:12 +02:00
parent c95cd06dac
commit 6e9d4ed6a0
2 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ export function ErrorHandler(error: Error, req: Request, res: Response, next: Ne
code = error.code;
message = error.message;
httpcode = error.httpStatus;
} else if (error as EntityNotFoundError) {
} else if (error instanceof EntityNotFoundError) {
message = `${(error as any).stringifyTarget} could not be found`;
code = 404;
} else if (error instanceof FieldError) {

View File

@@ -22,7 +22,7 @@ export default function TestClient(app: Application) {
html = html.replace(/GATEWAY_ENDPOINT: .+/, `GATEWAY_ENDPOINT: \`${GATEWAY_ENDPOINT}\`,`);
}
app.use("/assets", express.static(path.join(__dirname, "..", "assets")));
app.use("/assets", express.static(path.join(__dirname, "..", "..", "assets")));
app.get("/assets/:file", async (req: Request, res: Response) => {
delete req.headers.host;