diff --git a/.vscode/launch.json b/.vscode/launch.json index aa46e14..4449892 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "skipFiles": [ "/**" ], - "program": "${workspaceFolder}/src/server/main.ts", + "program": "${workspaceFolder}/src/main.ts", "preLaunchTask": "tsc: build - tsconfig.json", "outFiles": [ "${workspaceFolder}/dist/**/*.js" diff --git a/src/server/main.ts b/src/main.ts similarity index 57% rename from src/server/main.ts rename to src/main.ts index 000999d..101dc61 100644 --- a/src/server/main.ts +++ b/src/main.ts @@ -1,15 +1,14 @@ -import { ConfigService } from '@nestjs/config'; import { NestFactory } from '@nestjs/core'; import createServer from 'next/dist/server/next'; -import { AppModule } from './app.module'; -import { HttpExceptionFilter } from './next.filter'; +import { AppModule } from './server/app.module'; +import { HttpExceptionFilter } from './server/next.filter'; +import config from './nest.config.json'; async function bootstrap() { const app = await NestFactory.create(AppModule); - - const configService = app.get(ConfigService); + await app.init(); const nextServer = createServer({ - dev: configService.get('NODE_ENV') !== 'production', + dev: config.NODE_ENV !== 'production', dir: './src/client', }); await nextServer.prepare(); diff --git a/src/nest.config.json b/src/nest.config.json new file mode 100644 index 0000000..8bed595 --- /dev/null +++ b/src/nest.config.json @@ -0,0 +1,3 @@ +{ + "NODE_ENV": "development" +} diff --git a/tsconfig.json b/tsconfig.json index 3d4fc64..9abbbda 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,16 +17,10 @@ "strictBindCallApply": false, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "strict": true, - "noEmit": true, "esModuleInterop": true, - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, + "resolveJsonModule": true, "jsx": "preserve" }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + // "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + // "exclude": ["node_modules"] }