MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / allowOnlyPost

Function allowOnlyPost

packages/baseai/src/dev/middleware/post-only.ts:3–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import {MiddlewareHandler} from 'hono';
2
3export const allowOnlyPost = (): MiddlewareHandler => {
4 return async function allowOnlyPost(c, next) {
5 if (c.req.method !== 'POST') {
6 return c.json({message: 'Bad Request - Only POST requests allowed.'}, 400);
7 }
8 await next();
9 };
10};

Callers

nothing calls this directly

Calls 1

nextFunction · 0.50

Tested by

no test coverage detected