fix(backend): Remove duplicate OPTIONS handler to resolve Startup Crash
This commit is contained in:
parent
8ed82cfab6
commit
7386b5c6c5
1 changed files with 1 additions and 7 deletions
|
|
@ -41,13 +41,7 @@ server.register(cors, {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manual OPTIONS handler as fallback
|
// Manual OPTIONS handler as fallback
|
||||||
server.options('/*', async (request, reply) => {
|
// Manual OPTIONS handler removed as it conflicts with @fastify/cors plugin
|
||||||
reply.header('Access-Control-Allow-Origin', request.headers.origin || '*');
|
|
||||||
reply.header('Access-Control-Allow-Credentials', 'true');
|
|
||||||
reply.header('Access-Control-Allow-Methods', 'GET,POST,PUT,PATCH,DELETE,OPTIONS');
|
|
||||||
reply.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
|
|
||||||
return reply.send();
|
|
||||||
});
|
|
||||||
server.register(prismaPlugin);
|
server.register(prismaPlugin);
|
||||||
server.register(jwt, {
|
server.register(jwt, {
|
||||||
secret: process.env.JWT_SECRET || 'supersecret'
|
secret: process.env.JWT_SECRET || 'supersecret'
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue