handle server errors (#91)

This commit is contained in:
Olivier Chafik 2025-12-08 18:45:31 +01:00 • committed by GitHub
commit 3dde360dc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,7 +85,11 @@ app.post("/mcp", async (req: Request, res: Response) => {
}
});
const httpServer = app.listen(PORT, () => {
const httpServer = app.listen(PORT, err => {
if (err) {
console.error("Error starting server:", err);
process.exit(1);
}
console.log(`Server listening on http://localhost:${PORT}/mcp`);
});