[WIKI-565] chore: handle 404 messages in live server (#7472)

* chore: handle 404 messages in live server

* chore: removed error stack from response
This commit is contained in:
sriram veeraghanta
2025-07-24 15:13:44 +05:30
committed by GitHub
parent 2746bad86b
commit 849b7b7bf3
2 changed files with 6 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
PORT=3100
API_BASE_URL="http://localhost:8000"
WEB_BASE_URL="http://localhost:3000"

View File

@@ -82,14 +82,16 @@ export class Server {
});
} catch (error) {
manualLogger.error("Error in /convert-document endpoint:", error);
res.status(500).send({
message: `Internal server error. ${error}`,
res.status(500).json({
message: `Internal server error.`,
});
}
});
this.app.use((_req: Request, res: Response) => {
res.status(404).send("Not Found");
res.status(404).json({
message: "Not Found",
});
});
}