Skip to content

Commit

Permalink
setting: app -> socket 으로 명칭 변경
Browse files Browse the repository at this point in the history
- app.controller.ts -> socket.controller.ts
- app.controller.ts -> socket.controller.ts
- app.controller.ts -> socket.module.ts
- app.controller.spec.ts -> socket.controller.spec.ts
- app.e2e-spec.ts
  • Loading branch information
soomanbaek committed Nov 14, 2022
1 parent f72cc22 commit 54ebdee
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 52 deletions.
5 changes: 2 additions & 3 deletions server/apps/api/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { NestFactory } from '@nestjs/core';
import { ApiModule } from './api.module';

import * as dotenv from 'dotenv';

async function bootstrap() {
const app = await NestFactory.create(ApiModule);
await app.listen(3000);
console.log('hello api server');
console.log(process.env.NODE_ENV);
console.log(dotenv);
}
bootstrap();
22 changes: 0 additions & 22 deletions server/apps/socket/src/app.controller.spec.ts

This file was deleted.

12 changes: 0 additions & 12 deletions server/apps/socket/src/app.controller.ts

This file was deleted.

10 changes: 0 additions & 10 deletions server/apps/socket/src/app.module.ts

This file was deleted.

4 changes: 2 additions & 2 deletions server/apps/socket/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SocketModule } from './socket.module';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create(SocketModule);
await app.listen(3000);
}
bootstrap();
22 changes: 22 additions & 0 deletions server/apps/socket/src/socket.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Test, TestingModule } from '@nestjs/testing';
import { SocketController } from './socket.controller';
import { SocketService } from './socket.service';

describe('SocketController', () => {
let socketController: SocketController;

beforeEach(async () => {
const app: TestingModule = await Test.createTestingModule({
controllers: [SocketController],
providers: [SocketService],
}).compile();

socketController = app.get<SocketController>(SocketController);
});

describe('root', () => {
it('should return "Hello World!"', () => {
expect(socketController.getHello()).toBe('Hello World!');
});
});
});
12 changes: 12 additions & 0 deletions server/apps/socket/src/socket.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Controller, Get } from '@nestjs/common';
import { SocketService } from './socket.service';

@Controller()
export class SocketController {
constructor(private readonly socketService: SocketService) {}

@Get()
getHello(): string {
return this.socketService.getHello();
}
}
10 changes: 10 additions & 0 deletions server/apps/socket/src/socket.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Module } from '@nestjs/common';
import { SocketController } from './socket.controller';
import { SocketService } from './socket.service';

@Module({
imports: [],
controllers: [SocketController],
providers: [SocketService],
})
export class SocketModule {}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
export class SocketService {
getHello(): string {
return 'Hello World!';
}
Expand Down
4 changes: 2 additions & 2 deletions server/apps/socket/test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from './../src/app.module';
import { SocketModule } from '../src/socket.module';

describe('AppController (e2e)', () => {
let app: INestApplication;

beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
imports: [SocketModule],
}).compile();

app = moduleFixture.createNestApplication();
Expand Down

0 comments on commit 54ebdee

Please sign in to comment.