next-auto-logger
Version:
Universal Pino-based request logger for Next.js - auto-detects client/server, structured JSON logs for CloudWatch
16 lines (13 loc) • 567 B
TypeScript
import { NextApiRequest, NextApiResponse } from 'next';
import { NextRequest } from 'next/server';
declare module 'pino' {
interface LogFn {
(obj: object, msg?: string, ...args: any[]): void;
(msg: string, ...args: any[]): void;
(...args: any[]): void;
}
}
declare function handler(req: NextApiRequest, res: NextApiResponse): Promise<void | NextApiResponse<any>>;
declare function POST(req: NextRequest): Promise<Response>;
declare function OPTIONS(req: NextRequest): Promise<Response>;
export { OPTIONS, POST, handler as default };