-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
1 parent
f72cc22
commit 54ebdee
Showing
10 changed files
with
51 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} |
2 changes: 1 addition & 1 deletion
2
server/apps/socket/src/app.service.ts → server/apps/socket/src/socket.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters