diff --git a/src/web/app.ts b/src/web/app.ts index 88766fa..1545c8a 100644 --- a/src/web/app.ts +++ b/src/web/app.ts @@ -21,7 +21,9 @@ export default async function makeApp(fastify: FastifyInstance) { // Configure CORS await fastify.register(Cors, { - origin: false, // TODO: Set this to a valid origin + origin: '*', + methods: ['GET', 'POST', 'PUT', 'DELETE'], + allowedHeaders: ['Content-Type', 'Authorization'], }); // Auto-load plugins diff --git a/src/web/server.ts b/src/web/server.ts index 21fb7ac..876b729 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -1,5 +1,4 @@ import dotenv from 'dotenv'; -import cors from '@fastify/cors'; import Fastify from 'fastify'; import app from './app'; @@ -13,12 +12,6 @@ async function start() { }, }); - await fastify.register(cors, { - origin: '*', - methods: ['GET', 'POST', 'PUT', 'DELETE'], - allowedHeaders: ['Content-Type', 'Authorization'], - }); - await app(fastify); const applicationConfig = fastify.diContainer.cradle.config;