mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-11 01:15:40 +00:00
🐛 fix error handler and asset router
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user