generated from nhcarrigan/template
feat: allow any origin with CORS in favour of our manual validation
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fastify/cors": "10.0.2",
|
||||
"@nhcarrigan/logger": "1.0.0",
|
||||
"@prisma/client": "6.3.1",
|
||||
"fastify": "5.2.1",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import cors from "@fastify/cors";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import fastify from "fastify";
|
||||
import { authHook } from "./hooks/auth.js";
|
||||
@@ -25,6 +26,10 @@ try {
|
||||
logger: false,
|
||||
});
|
||||
|
||||
server.register(cors, {
|
||||
origin: "*",
|
||||
});
|
||||
|
||||
server.addHook("preHandler", authHook);
|
||||
server.addHook("preHandler", corsHook);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user