docs: add error handling when it fails to start HTTP server
This commit is contained in:
parent
3ef902328a
commit
4cd5e73a11
1 changed files with 5 additions and 1 deletions
|
|
@ -367,7 +367,11 @@ app.delete('/mcp', async (req: Request, res: Response) => {
|
|||
// Start the server
|
||||
const PORT = 3000;
|
||||
setupServer().then(() => {
|
||||
app.listen(PORT, () => {
|
||||
app.listen(PORT, (error) => {
|
||||
if (error) {
|
||||
console.error('Failed to start server:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(`MCP Streamable HTTP Server listening on port ${PORT}`);
|
||||
});
|
||||
}).catch(error => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue