forked from datawhale/whale-town-end
init:创建后端项目框架,确保环境的基本运行
This commit is contained in:
0
src/api/.gitkeep
Normal file
0
src/api/.gitkeep
Normal file
12
src/app.controller.ts
Normal file
12
src/app.controller.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
|
||||
@Get()
|
||||
getStatus(): string {
|
||||
return this.appService.getStatus();
|
||||
}
|
||||
}
|
||||
10
src/app.module.ts
Normal file
10
src/app.module.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
})
|
||||
export class AppModule {}
|
||||
8
src/app.service.ts
Normal file
8
src/app.service.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class AppService {
|
||||
getStatus(): string {
|
||||
return 'Pixel Game Server is running!';
|
||||
}
|
||||
}
|
||||
0
src/config/.gitkeep
Normal file
0
src/config/.gitkeep
Normal file
0
src/data/.gitkeep
Normal file
0
src/data/.gitkeep
Normal file
10
src/main.ts
Normal file
10
src/main.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
await app.listen(3000);
|
||||
console.log('Pixel Game Server is running on http://localhost:3000');
|
||||
}
|
||||
|
||||
bootstrap();
|
||||
0
src/model/.gitkeep
Normal file
0
src/model/.gitkeep
Normal file
0
src/service/.gitkeep
Normal file
0
src/service/.gitkeep
Normal file
0
src/utils/.gitkeep
Normal file
0
src/utils/.gitkeep
Normal file
Reference in New Issue
Block a user