@@ -1,4 +1,6 @@
|
||||
#
|
||||
# environment in ambiente di production
|
||||
#
|
||||
PORT=3001
|
||||
#
|
||||
KEYCLOAK_URL=http://localhost:8080
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
||||
import { join } from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { AppService } from './app.service';
|
||||
import { ShopController } from './shopController';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { KeycloakModule } from '@appweb/module';
|
||||
import { TraceMiddleware } from '../common/middleware/trace.middleware';
|
||||
|
||||
const debugPath = join(__dirname, '..', 'environment', '.env');
|
||||
console.log('--- DEBUG ENV ---');
|
||||
console.log('CWD attuale:', process.cwd());
|
||||
console.log('Percorso calcolato:', debugPath);
|
||||
console.log('Il file esiste?', fs.existsSync(debugPath));
|
||||
console.log('-----------------');
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
// 1. Configurazione del ConfigModule con le tue specifiche
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true, // Variabili disponibili ovunque
|
||||
cache: true, // Migliora le performance leggendo dal file solo una volta
|
||||
envFilePath: join(process.cwd(), 'gateway/.env'), // Percorso del file (cercato nella root del workspace Nx)
|
||||
envFilePath: [
|
||||
join(process.cwd(), 'apps/gateway/.env.local'),
|
||||
join(process.cwd(), 'apps/gateway/.env'),
|
||||
join(process.cwd(), '.env'),
|
||||
],
|
||||
}),
|
||||
KeycloakModule,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user