feat: init

This commit is contained in:
2025-03-18 06:21:27 +08:00
parent 595e8d29dc
commit 16c807b98e
37 changed files with 5349 additions and 69 deletions

8
apps/mock/nest-cli.json Normal file
View File

@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}

25
apps/mock/package.json Normal file
View File

@@ -0,0 +1,25 @@
{
"name": "mock",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "nest start --watch -b swc",
"dev": "pnpm run start"
},
"keywords": [],
"license": "MIT",
"dependencies": {
"@nestjs/common": "^11.0.11",
"@nestjs/config": "^4.0.1",
"@nestjs/core": "^11.0.11",
"@nestjs/platform-express": "^11.0.11",
"@nestjs/serve-static": "^5.0.3",
"reflect-metadata": "^0.2.2"
},
"devDependencies": {
"@nestjs/cli": "^11.0.0",
"@nestjs/schematics": "^11.0.0",
"@swc/cli": "^0.6.0",
"@swc/core": "^1.11.8"
}
}

Binary file not shown.

Binary file not shown.

View 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
View 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();

28
apps/mock/tsconfig.json Normal file
View File

@@ -0,0 +1,28 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"module": "CommonJS",
"moduleResolution": "node",
"declaration": true,
"emitDeclarationOnly": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowImportingTsExtensions": false,
"outDir": "./dist",
"rootDir": ".",
"baseUrl": ".",
"lib": [
"ES2024"
]
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dist",
"test",
"**/*spec.ts"
]
}