Skip to content

Commit

Permalink
Merge pull request #89 from asn6878/feat/cors-enable
Browse files Browse the repository at this point in the history
✨ feat: CORS 허용 설정
  • Loading branch information
asn6878 authored Nov 14, 2024
2 parents bb5a26f + bd3593b commit e58644c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "cross-env NODE_ENV=development node dist/main.js",
"start": "cross-env NODE_ENV=production node dist/src/main.js",
"start:dev": "cross-env NODE_ENV=development nest start --watch",
"start:debug": "cross-env NODE_ENV=development nest start --debug --watch",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
Expand Down
5 changes: 5 additions & 0 deletions server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ import { GlobalExceptionsFilter } from './common/filters/global-exceptions.filte
async function bootstrap() {
const app = await NestFactory.create(AppModule);
setupSwagger(app);

app.setGlobalPrefix('api');
app.useGlobalFilters(new GlobalExceptionsFilter());
app.enableCors({
origin: ['http://localhost:3000', 'https://denamu.netlify.app/'],
credentials: true,
});
await app.listen(process.env.PORT ?? 3000);
}

Expand Down

0 comments on commit e58644c

Please sign in to comment.