Skip to main content
Glama
zqushair
by zqushair
swagger.ts1.72 kB
import swaggerJsdoc from 'swagger-jsdoc'; import swaggerUi from 'swagger-ui-express'; import { Express } from 'express'; import { config } from '../config/index.js'; import logger from '../utils/logger.js'; // Swagger definition const swaggerOptions = { definition: { openapi: '3.0.0', info: { title: 'Frontapp MCP API', version: '1.0.0', description: 'API documentation for the Frontapp MCP integration', contact: { name: 'API Support', email: 'support@example.com', }, }, servers: [ { url: `http://localhost:${config.server.port}`, description: 'Development server', }, { url: config.webhook.baseUrl || 'https://api.example.com', description: 'Production server', }, ], components: { securitySchemes: { ApiKeyAuth: { type: 'apiKey', in: 'header', name: 'X-API-Key', }, }, }, security: [ { ApiKeyAuth: [], }, ], }, apis: ['./src/api/*.ts', './src/models/*.ts'], // Path to the API docs }; // Initialize swagger-jsdoc const swaggerSpec = swaggerJsdoc(swaggerOptions); /** * Configure Swagger UI * @param app Express application */ export function setupSwagger(app: Express): void { // Serve swagger docs app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec)); // Serve swagger spec as JSON app.get('/api-docs.json', (req, res) => { res.setHeader('Content-Type', 'application/json'); res.send(swaggerSpec); }); logger.info('Swagger documentation initialized', { url: `http://localhost:${config.server.port}/api-docs`, }); } export default swaggerSpec;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zqushair/Frontapp-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server