feat: docker init

This commit is contained in:
Innei
2021-07-29 19:37:55 +08:00
parent 08b725befd
commit c92d723ea1
12 changed files with 346 additions and 19 deletions

View File

@@ -2,9 +2,10 @@ import { Module } from '@nestjs/common'
import { AppController } from './app.controller'
import { AppService } from './app.service'
import { InitModule } from './modules/init/init.module'
import { UserModule } from './modules/user/user.module';
@Module({
imports: [InitModule],
imports: [InitModule, UserModule],
controllers: [AppController],
providers: [AppService],
})

View File

@@ -5,7 +5,8 @@ import { fastifyApp } from './core/adapt/fastify'
import { isDev } from './utils'
import { Logger } from '@nestjs/common'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
const PORT = parseInt(process.env.PORT) || 2333
// const PORT = parseInt(process.env.PORT) || 2333
const PORT = 2333
const APIVersion = 1
const Origin = process.env.ORIGIN || ''

View File

@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { UserController } from './user.controller';
describe('UserController', () => {
let controller: UserController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [UserController],
}).compile();
controller = module.get<UserController>(UserController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@@ -0,0 +1,4 @@
import { Controller } from '@nestjs/common';
@Controller('user')
export class UserController {}

View File

View File

@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common'
import { UserController } from './user.controller'
import { UserService } from './user.service'
@Module({
controllers: [UserController],
providers: [UserService],
})
export class UserModule {}

View File

@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { UserService } from './user.service';
describe('UserService', () => {
let service: UserService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [UserService],
}).compile();
service = module.get<UserService>(UserService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class UserService {}