Skip to content

Commit

Permalink
chore: 프론트엔드 연동을 위한 설정(cors 등) 수행
Browse files Browse the repository at this point in the history
  • Loading branch information
blaxsior committed Dec 12, 2023
1 parent 3b9fb2d commit 1c07e7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ async function bootstrap() {
if (process.env.NODE_ENV !== 'production') {
swaggerSetup(app);
}
app.enableCors();

const frontPath = process.env.FRONT_ORIGIN;
app.enableCors({
origin: frontPath,
credentials: true,
});
app.use(helmet());
app.use(cookieParser());
app.useGlobalPipes(
Expand Down
4 changes: 4 additions & 0 deletions backend/server/src/util/options/config.option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class EnvironmentVariables {

@IsString()
REDIS_HOST: string;

@IsString()
FRONT_ORIGIN: string;

@IsNumber()
@Transform(({ value }) => parseInt(value))
REDIS_PORT: number;
Expand Down

0 comments on commit 1c07e7d

Please sign in to comment.