feat: init
This commit is contained in:
19
apps/mock/src/app.module.ts
Normal file
19
apps/mock/src/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
import path from 'node:path';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath: path.join(__dirname, '..', 'public'),
|
||||
serveRoot: '/api/static',
|
||||
serveStaticOptions: {
|
||||
cacheControl: true,
|
||||
maxAge: '1d',
|
||||
},
|
||||
})
|
||||
],
|
||||
controllers: [],
|
||||
providers: [],
|
||||
})
|
||||
export class AppModule { }
|
||||
8
apps/mock/src/main.ts
Normal file
8
apps/mock/src/main.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
await app.listen(process.env.port ?? 5001);
|
||||
}
|
||||
bootstrap();
|
||||
Reference in New Issue
Block a user