diff --git a/generators/app/templates/infrastructure/.dockerignore b/generators/app/templates/infrastructure/.dockerignore index 4fa8730..e57fcae 100644 --- a/generators/app/templates/infrastructure/.dockerignore +++ b/generators/app/templates/infrastructure/.dockerignore @@ -3,6 +3,7 @@ **/.gitignore **/Dockerfile* **/node_modules +**/iisnode LICENSE README.md .dockerignore diff --git a/generators/app/templates/infrastructure/.gitignore-template b/generators/app/templates/infrastructure/.gitignore-template index 23ee9ae..a153800 100644 --- a/generators/app/templates/infrastructure/.gitignore-template +++ b/generators/app/templates/infrastructure/.gitignore-template @@ -36,6 +36,7 @@ build/Release # Dependency directories node_modules/ jspm_packages/ +iisnode/ # TypeScript v1 declaration files typings/ diff --git a/generators/app/templates/infrastructure/src/index.js b/generators/app/templates/infrastructure/src/index.js index d9efca3..c5f3d57 100644 --- a/generators/app/templates/infrastructure/src/index.js +++ b/generators/app/templates/infrastructure/src/index.js @@ -1,13 +1,21 @@ //env -const dotenv = require('dotenv'); -const result = dotenv.config(); +process.chdir(`${__dirname}/..`) +const dotenv = require('dotenv') +const result = dotenv.config() if (result.error) { - const path = `.env`; - dotenv.config({ path }); + console.warn('No .env file found in current working directory:', result.error) + const path = `.env` + const pathResult = dotenv.config({ path }) + if (pathResult.error) { + console.warn('No .env file found in project root directory:', pathResult.error) + } } if (process.env.NODE_ENV) { - dotenv.config({ path: `./.env.${process.env.NODE_ENV}`, override: true }); + const nodeEnvResult = dotenv.config({ path: `./.env.${process.env.NODE_ENV}`, override: true }) + if (nodeEnvResult.error) { + console.warn(`No .env.${process.env.NODE_ENV} file found in project root directory:`, nodeEnvResult.error) + } } const keyPerFileEnv = require('@totalsoft/key-per-file-configuration')