cal.pub0.org/lib/helpers/withMiddleware.ts

15 lines
446 B
TypeScript

import { label } from "next-api-middleware";
import { addRequestId } from "./addRequestid";
import { captureErrors } from "./captureErrors";
import { verifyApiKey } from "./verifyApiKey";
const withMiddleware = label(
{
addRequestId,
verifyApiKey,
sentry: captureErrors, // <-- Optionally alias middleware
},
["sentry","verifyApiKey"] // <-- Provide a list of middleware to call automatically
);
export default withMiddleware;