diff --git a/packages/canyon-backend/package.json b/packages/canyon-backend/package.json index 82b1e7d4..e6dde2ae 100644 --- a/packages/canyon-backend/package.json +++ b/packages/canyon-backend/package.json @@ -6,7 +6,7 @@ "private": true, "license": "UNLICENSED", "scripts": { - "do-build": "nest build", + "do-build": "prisma generate && nest build", "start": "nest start", "start:dev": "nest start --watch", "preinstall": "prisma generate && nest build" @@ -19,7 +19,8 @@ "express": "^4.21.1", "prisma": "5.16.1", "reflect-metadata": "^0.2.0", - "rxjs": "^7.8.1" + "rxjs": "^7.8.1", + "dotenv": "^16.4.5" }, "devDependencies": { "@nestjs/cli": "^10.0.0", diff --git a/packages/canyon-backend/src/main.ts b/packages/canyon-backend/src/main.ts index 8149f131..4072845e 100644 --- a/packages/canyon-backend/src/main.ts +++ b/packages/canyon-backend/src/main.ts @@ -1,7 +1,10 @@ import { NestFactory } from '@nestjs/core'; import { json } from 'express'; -import * as fs from 'fs'; -import * as path from 'node:path'; +import dotenv from "dotenv"; +import path from 'node:path'; +dotenv.config({ + path: path.resolve(__dirname, "../../../.env"), +}); async function bootstrap() { const { AppModule } = await import('./app.module'); const app = await NestFactory.create(AppModule); diff --git a/packages/canyon-collect/package.json b/packages/canyon-collect/package.json index 966e70dc..52510a2d 100644 --- a/packages/canyon-collect/package.json +++ b/packages/canyon-collect/package.json @@ -19,7 +19,8 @@ "express": "^4.21.1", "prisma": "5.16.1", "reflect-metadata": "^0.2.0", - "rxjs": "^7.8.1" + "rxjs": "^7.8.1", + "dotenv": "^16.4.5" }, "devDependencies": { "@nestjs/cli": "^10.0.0", diff --git a/packages/canyon-collect/src/main.ts b/packages/canyon-collect/src/main.ts index 8149f131..4072845e 100644 --- a/packages/canyon-collect/src/main.ts +++ b/packages/canyon-collect/src/main.ts @@ -1,7 +1,10 @@ import { NestFactory } from '@nestjs/core'; import { json } from 'express'; -import * as fs from 'fs'; -import * as path from 'node:path'; +import dotenv from "dotenv"; +import path from 'node:path'; +dotenv.config({ + path: path.resolve(__dirname, "../../../.env"), +}); async function bootstrap() { const { AppModule } = await import('./app.module'); const app = await NestFactory.create(AppModule);