Skip to content

Commit fe11126

Browse files
committed
feat: test disable cors
1 parent da6c92b commit fe11126

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

apps/api/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"dependencies": {
3030
"@codeimage/prisma-models": "workspace:*",
3131
"@fastify/autoload": "^5.2.0",
32+
"@fastify/cors": "8.1.0",
3233
"@fastify/env": "^4.1.0",
3334
"@fastify/jwt": "6.3.2",
3435
"@fastify/sensible": "^5.1.0",

apps/api/src/server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Read the .env file.
2+
import fastifyCors from '@fastify/cors';
23
// Require library to exit fastify process, gracefully (if possible)
34
import * as closeWithGrace from 'close-with-grace';
45
import * as dotenv from 'dotenv';
@@ -12,6 +13,10 @@ const app = Fastify({
1213
logger: true,
1314
});
1415

16+
app.register(fastifyCors, {
17+
// TODO: fix
18+
origin: '*',
19+
});
1520
// Register your application as a normal plugin.
1621
app.register(import('./app'));
1722

0 commit comments

Comments
 (0)