Skip to content

Commit

Permalink
Merge pull request #613 from boostcampwm2023/BE/bugfix/#612-공유-라이브러리-…
Browse files Browse the repository at this point in the history
…내에서-사용하는-패키지-못-찾음

Be/bugfix/#612 공유 라이브러리 내에서 사용하는 패키지 못 찾음
  • Loading branch information
kimyu0218 authored May 16, 2024
2 parents 93c3cb2 + 96c7f9d commit ff40991
Show file tree
Hide file tree
Showing 11 changed files with 1,738 additions and 1,167 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/blue-green-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Blue/Green CD for Backend

on:
push:
#paths: ["backend/**"]
#branches: ["release", "*hotfix*"]
paths: ["backend/**"]
branches: ["release", "*hotfix*"]

env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
86 changes: 50 additions & 36 deletions README.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions backend/Dockerfile.signal
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ WORKDIR /app/signal

COPY signal/package*.json ./
RUN npm ci
RUN mv ../socket-event/dist ./node_modules/socket-event
RUN mv ../winston-logger/dist ./node_modules/winston-logger
RUN npm run move:logger && npm run move:event

COPY signal .
RUN npm run build
Expand Down
3 changes: 1 addition & 2 deletions backend/Dockerfile.was
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ WORKDIR /app/was

COPY was/package*.json ./
RUN npm ci
RUN mv ../socket-event/dist ./node_modules/socket-event
RUN mv ../winston-logger/dist ./node_modules/winston-logger
RUN npm run move:logger && npm run move:event

COPY was .
RUN npm run build
Expand Down
2 changes: 2 additions & 0 deletions backend/signal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"move:logger": "mv ../winston-logger/dist ./node_modules/winston-logger && mv ../winston-logger/node_modules ./node_modules/winston-logger/node_modules",
"move:event": "mv ../socket-event/dist ./node_modules/socket-event && mv ../socket-event/node_modules ./node_modules/socket-event/node_modules",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
5 changes: 4 additions & 1 deletion backend/signal/src/events/events.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
WebSocketGateway,
WebSocketServer,
} from '@nestjs/websockets';
import * as dotenv from 'dotenv';
import type {
HumanServer,
HumanSocket,
Expand All @@ -15,10 +16,12 @@ import type {
import { LoggerService } from 'src/logger/logger.service';
import { v4 } from 'uuid';

dotenv.config();

const MAXIMUM = 2;

@WebSocketGateway({
cors: { origin: '*' },
cors: { origin: process.env.CORS_ALLOW_DOMAIN, credentials: true },
path: '/signal',
})
export class EventsGateway
Expand Down
8 changes: 6 additions & 2 deletions backend/signal/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { NestFactory } from '@nestjs/core';
import * as dotenv from 'dotenv';
import { AppModule } from './app.module';
import { LoggerService } from './logger/logger.service';

dotenv.config();

async function bootstrap() {
const app = await NestFactory.create(AppModule);

const logger: LoggerService = app.get(LoggerService);

app.enableCors({
origin: process.env.CORS_ALLOW_DOMAIN,
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
credentials: true,
allowedHeaders: ['Authorization', 'Content-type'],
allowedHeaders: ['Authorization', 'Content-type', 'samesite'],
});

const logger: LoggerService = app.get(LoggerService);
app.useLogger(logger);

const port: number = parseInt(process.env.PORT || '3001');
Expand Down
Loading

0 comments on commit ff40991

Please sign in to comment.