mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-25 13:02:15 +03:00
eb2b89694a
closes #4103 <img width="696" alt="Bildschirmfoto 2024-05-10 um 08 16 19" src="https://github.com/twentyhq/twenty/assets/48770548/e34cd348-2522-408c-886c-636595292e0f">
23 lines
592 B
TypeScript
23 lines
592 B
TypeScript
import { NextResponse } from 'next/server';
|
|
|
|
export function middleware() {
|
|
const res = NextResponse.next();
|
|
|
|
res.headers.append('Access-Control-Allow-Origin', '*');
|
|
res.headers.append('Access-Control-Allow-Credentials', 'true');
|
|
res.headers.append(
|
|
'Access-Control-Allow-Methods',
|
|
'GET,DELETE,PATCH,POST,PUT',
|
|
);
|
|
res.headers.append(
|
|
'Access-Control-Allow-Headers',
|
|
'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version',
|
|
);
|
|
|
|
return res;
|
|
}
|
|
|
|
export const config = {
|
|
matcher: '/api/:path*',
|
|
};
|