@newt-app/templates 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +26 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1054,31 +1054,6 @@ import { TodosModule } from './todos/todos.module';
|
|
|
1054
1054
|
export class AppModule {}`
|
|
1055
1055
|
};
|
|
1056
1056
|
|
|
1057
|
-
// src/api/templates/main.ts
|
|
1058
|
-
var main_default = {
|
|
1059
|
-
filename: "apps/api/src/main.ts",
|
|
1060
|
-
template: `import dotenv from 'dotenv';
|
|
1061
|
-
import { resolve } from 'path';
|
|
1062
|
-
|
|
1063
|
-
// Load root .env first, then local .env (local takes precedence)
|
|
1064
|
-
dotenv.config({ path: resolve(process.cwd(), '../../.env') });
|
|
1065
|
-
dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
1066
|
-
|
|
1067
|
-
import { NestFactory } from '@nestjs/core';
|
|
1068
|
-
import { AppModule } from './app.module';
|
|
1069
|
-
|
|
1070
|
-
async function bootstrap() {
|
|
1071
|
-
const app = await NestFactory.create(AppModule, { bodyParser: false });
|
|
1072
|
-
app.setGlobalPrefix('api');
|
|
1073
|
-
app.enableCors({
|
|
1074
|
-
origin: process.env.CORS_ORIGIN ?? 'http://localhost:3000',
|
|
1075
|
-
credentials: true,
|
|
1076
|
-
});
|
|
1077
|
-
await app.listen(process.env.PORT ?? 3001);
|
|
1078
|
-
}
|
|
1079
|
-
void bootstrap();`
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
1057
|
// src/api/templates/todos-module.ts
|
|
1083
1058
|
var todos_module_default = {
|
|
1084
1059
|
filename: "apps/api/src/todos/todos.module.ts",
|
|
@@ -1182,7 +1157,6 @@ var api = {
|
|
|
1182
1157
|
tsconfig_default2,
|
|
1183
1158
|
tsconfig_build_default,
|
|
1184
1159
|
app_module_default,
|
|
1185
|
-
main_default,
|
|
1186
1160
|
todos_module_default,
|
|
1187
1161
|
todos_service_default,
|
|
1188
1162
|
todos_service_spec_default,
|
|
@@ -9409,6 +9383,31 @@ import { TodosModule } from './todos/todos.module';
|
|
|
9409
9383
|
export class AppModule {}`
|
|
9410
9384
|
};
|
|
9411
9385
|
|
|
9386
|
+
// src/api/templates/main.ts
|
|
9387
|
+
var main_default = {
|
|
9388
|
+
filename: "apps/api/src/main.ts",
|
|
9389
|
+
template: `import dotenv from 'dotenv';
|
|
9390
|
+
import { resolve } from 'path';
|
|
9391
|
+
|
|
9392
|
+
// Load root .env first, then local .env (local takes precedence)
|
|
9393
|
+
dotenv.config({ path: resolve(process.cwd(), '../../.env') });
|
|
9394
|
+
dotenv.config({ path: resolve(process.cwd(), '.env') });
|
|
9395
|
+
|
|
9396
|
+
import { NestFactory } from '@nestjs/core';
|
|
9397
|
+
import { AppModule } from './app.module';
|
|
9398
|
+
|
|
9399
|
+
async function bootstrap() {
|
|
9400
|
+
const app = await NestFactory.create(AppModule, { bodyParser: false });
|
|
9401
|
+
app.setGlobalPrefix('api');
|
|
9402
|
+
app.enableCors({
|
|
9403
|
+
origin: process.env.CORS_ORIGIN ?? 'http://localhost:3000',
|
|
9404
|
+
credentials: true,
|
|
9405
|
+
});
|
|
9406
|
+
await app.listen(process.env.PORT ?? 3001);
|
|
9407
|
+
}
|
|
9408
|
+
void bootstrap();`
|
|
9409
|
+
};
|
|
9410
|
+
|
|
9412
9411
|
// src/api-controllers/templates/todos-controller.ts
|
|
9413
9412
|
var todos_controller_default = {
|
|
9414
9413
|
filename: "apps/api/src/todos/todos.controller.ts",
|
|
@@ -9469,6 +9468,7 @@ var apiControllers = {
|
|
|
9469
9468
|
app_controller_default,
|
|
9470
9469
|
app_controller_spec_default,
|
|
9471
9470
|
app_module_default2,
|
|
9471
|
+
main_default,
|
|
9472
9472
|
todos_controller_default,
|
|
9473
9473
|
todos_module_default2
|
|
9474
9474
|
]
|