mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
20 lines
493 B
TypeScript
20 lines
493 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
export function middleware() {
|
|
const res = NextResponse.next()
|
|
|
|
res.headers.append('Access-Control-Allow-Credentials', "true")
|
|
res.headers.append('Access-Control-Allow-Origin', process.env.CORS_ORIGIN || "")
|
|
res.headers.append('Access-Control-Allow-Methods', 'GET,POST,OPTIONS')
|
|
res.headers.append(
|
|
'Access-Control-Allow-Headers',
|
|
'Content-Type, Authorization'
|
|
)
|
|
|
|
return res
|
|
}
|
|
|
|
export const config = {
|
|
matcher: '/:path*',
|
|
}
|