Skip to content

Commit 4cd5e73

Browse files
docs: add error handling when it fails to start HTTP server
1 parent 3ef9023 commit 4cd5e73

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,11 @@ app.delete('/mcp', async (req: Request, res: Response) => {
367367
// Start the server
368368
const PORT = 3000;
369369
setupServer().then(() => {
370-
app.listen(PORT, () => {
370+
app.listen(PORT, (error) => {
371+
if (error) {
372+
console.error('Failed to start server:', error);
373+
process.exit(1);
374+
}
371375
console.log(`MCP Streamable HTTP Server listening on port ${PORT}`);
372376
});
373377
}).catch(error => {

0 commit comments

Comments
 (0)