- Refactored main application entry point to use centralized configuration - Created modular route structure with separate files for different API endpoints - Introduced app.config.ts for centralized environment variable management - Moved tools and route logic into dedicated files - Simplified index.ts and improved overall project organization - Added comprehensive type definitions for tools and API interactions
39 lines
1011 B
TypeScript
39 lines
1011 B
TypeScript
/**
|
|
* API Routes Module
|
|
*
|
|
* This module exports the main router that combines all API routes
|
|
* into a single router instance. Each route group is mounted under
|
|
* its respective path prefix.
|
|
*
|
|
* @module routes
|
|
*/
|
|
|
|
import { Router } from 'express';
|
|
import { mcpRoutes } from './mcp.routes';
|
|
import { sseRoutes } from './sse.routes';
|
|
import { toolRoutes } from './tool.routes';
|
|
import { healthRoutes } from './health.routes';
|
|
|
|
/**
|
|
* Create main router instance
|
|
* This router will be mounted at /api in the main application
|
|
*/
|
|
const router = Router();
|
|
|
|
/**
|
|
* Mount all route groups
|
|
* - /mcp: MCP schema and execution endpoints
|
|
* - /sse: Server-Sent Events endpoints
|
|
* - /tools: Tool management endpoints
|
|
* - /health: Health check endpoint
|
|
*/
|
|
router.use('/mcp', mcpRoutes);
|
|
router.use('/sse', sseRoutes);
|
|
router.use('/tools', toolRoutes);
|
|
router.use('/health', healthRoutes);
|
|
|
|
/**
|
|
* Export the configured router
|
|
* This will be mounted in the main application
|
|
*/
|
|
export { router as apiRoutes };
|