Skip to content

Commit

Permalink
Merge branch 'main' into refactor/user-based-route
Browse files Browse the repository at this point in the history
  • Loading branch information
vimkim authored Feb 11, 2024
2 parents e69eabb + 5be6298 commit 15b8200
Show file tree
Hide file tree
Showing 22 changed files with 306 additions and 112 deletions.
4 changes: 4 additions & 0 deletions server/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
};
2 changes: 1 addition & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ ARG DB_PORT
# Command to run the application
RUN npm run build
RUN chmod +x wait-for-mysql.sh
CMD ./wait-for-mysql.sh $DB_HOSTNAME $DB_PORT npm run start:prod
CMD ./wait-for-mysql.sh $DB_HOSTNAME $DB_PORT npm run prod
143 changes: 84 additions & 59 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint:dryrun": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"test": "jest",
"test": "jest --passWithNoTests",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
Expand Down Expand Up @@ -64,9 +64,9 @@
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.42.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
Expand All @@ -86,6 +86,10 @@
"ts"
],
"rootDir": "src",
"moduleNameMapper": {
"src/(.*)$": "<rootDir>/$1",
"test/(.*)$": "<rootDir>/$1"
},
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
Expand Down
7 changes: 4 additions & 3 deletions server/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
Req,
UseGuards,
} from '@nestjs/common';
import { AppService } from './app.service';
import { ApiTags } from '@nestjs/swagger';
import { Request } from 'express';
import { AppService } from './app.service';
import { SessionAuthGuard } from './auth/auth.guard';
import User from './entities/user.entity';
import { RoomService } from './room/room.service';
import { isUserSession, UserSession } from './types/user-session';
import { UserSession, isUserSession } from './types/user-session';

@ApiTags('app')
@UseGuards(SessionAuthGuard)
@Controller()
export class AppController {
Expand All @@ -24,7 +26,6 @@ export class AppController {

@Get()
getHello(): string {
// this.logger.log('get hello world');
return this.appService.getHello();
}

Expand Down
12 changes: 8 additions & 4 deletions server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthModule } from './auth/auth.module';
import { ProblemModule } from './problem/problem.module';
import { RoomUserModule } from './room-user/room-user.module';
import { RoomModule } from './room/room.module';
import { SocketModule } from './socket/socket.module';
import { UserModule } from './user/user.module';
import { ShortLoggerService } from './short-logger/short-logger.service';
import { SocketModule } from './socket/socket.module';
import { SubmissionModule } from './submission/submission.module';
import { UserModule } from './user/user.module';

@Module({
imports: [
Expand All @@ -30,7 +31,7 @@ import { SubmissionModule } from './submission/submission.module';
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
entities: [__dirname + '/**/*.entity.*'],
logging: false,
logging: true,
synchronize: true, // production시 false로 변경
namingStrategy: new SnakeNamingStrategy(),
}),
Expand All @@ -40,8 +41,11 @@ import { SubmissionModule } from './submission/submission.module';
RoomModule,
ProblemModule,
SubmissionModule,
RoomUserModule,
],
controllers: [AppController],
providers: [AppService, Logger, ShortLoggerService],
})
export class AppModule {}
export class AppModule {
constructor() {}
}
Loading

0 comments on commit 15b8200

Please sign in to comment.