Skip to content

Instantly share code, notes, and snippets.

@szymonkorytnicki
Created November 8, 2022 07:44
Show Gist options
  • Save szymonkorytnicki/20594f318fe0b4f3e245d071054c6cae to your computer and use it in GitHub Desktop.
Save szymonkorytnicki/20594f318fe0b4f3e245d071054c6cae to your computer and use it in GitHub Desktop.
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { anotherMiddleware } from './middlewares/anotherMiddleware';
import { someMiddleware } from './middlewares/someMiddleware';
type middlewareFunction = (request: NextRequest, response: NextResponse) => NextResponse | Promise<NextResponse>;
const MIDDLEWARES: middlewareFunction[] = [someMiddleware, anotherMiddleware];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment