Skip to main content
Glama

mcp-appstore

by appreply-co
allowedMethods.ts787 B
import { RequestHandler } from "express"; import { MethodNotAllowedError } from "../errors.js"; /** * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. * * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) * @returns Express middleware that returns a 405 error if method not in allowed list */ export function allowedMethods(allowedMethods: string[]): RequestHandler { return (req, res, next) => { if (allowedMethods.includes(req.method)) { next(); return; } const error = new MethodNotAllowedError(`The method ${req.method} is not allowed for this endpoint`); res.status(405) .set('Allow', allowedMethods.join(', ')) .json(error.toResponseObject()); }; }

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/appreply-co/mcp-appstore'

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