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

Function debugBase

packages/baseai/src/dev/middleware/debug-base.ts:4–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { dlog } from '../utils/dlog';
3
4export const debugBase = (): MiddlewareHandler => {
5 return async function debugUrl(c, next) {
6 const url = new URL(c.req.url);
7 const path = url.pathname;
8
9 dlog('API HIT', {
10 url: c.req.url,
11 path: path,
12 method: c.req.method
13 });
14
15 if (c.req.method.toUpperCase() === 'POST') {
16 try {
17 const req = await c.req.json();
18 dlog('REQUEST BODY', req);
19 } catch (error) {
20 dlog('ERROR PARSING REQUEST BODY', error);
21 }
22 }
23
24 await next();
25 };
26};

Callers

nothing calls this directly

Calls 2

dlogFunction · 0.90
nextFunction · 0.50

Tested by

no test coverage detected