3
.gitignore
vendored
3
.gitignore
vendored
@@ -42,3 +42,6 @@ Thumbs.db
|
|||||||
.nx/workspace-data
|
.nx/workspace-data
|
||||||
.claude/worktrees
|
.claude/worktrees
|
||||||
.claude/settings.local.json
|
.claude/settings.local.json
|
||||||
|
|
||||||
|
# environment in dev
|
||||||
|
.env.local
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#
|
#
|
||||||
|
# environment in ambiente di production
|
||||||
|
#
|
||||||
PORT=3001
|
PORT=3001
|
||||||
#
|
#
|
||||||
KEYCLOAK_URL=http://localhost:8080
|
KEYCLOAK_URL=http://localhost:8080
|
||||||
|
|||||||
@@ -1,26 +1,22 @@
|
|||||||
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import * as fs from 'fs';
|
|
||||||
import { AppService } from './app.service';
|
import { AppService } from './app.service';
|
||||||
import { ShopController } from './shopController';
|
import { ShopController } from './shopController';
|
||||||
import { ConfigModule } from '@nestjs/config';
|
import { ConfigModule } from '@nestjs/config';
|
||||||
import { KeycloakModule } from '@appweb/module';
|
import { KeycloakModule } from '@appweb/module';
|
||||||
import { TraceMiddleware } from '../common/middleware/trace.middleware';
|
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({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
// 1. Configurazione del ConfigModule con le tue specifiche
|
// 1. Configurazione del ConfigModule con le tue specifiche
|
||||||
ConfigModule.forRoot({
|
ConfigModule.forRoot({
|
||||||
isGlobal: true, // Variabili disponibili ovunque
|
isGlobal: true, // Variabili disponibili ovunque
|
||||||
cache: true, // Migliora le performance leggendo dal file solo una volta
|
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,
|
KeycloakModule,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#
|
#
|
||||||
|
# environment in ambiente di production
|
||||||
|
#
|
||||||
PORT=3002
|
PORT=3002
|
||||||
#
|
#
|
||||||
# Base URL del server
|
# Base URL del server
|
||||||
|
|||||||
Reference in New Issue
Block a user