|
@@ -1,3 +1,20 @@
|
|
|
|
+const dotenv = require('dotenv')
|
|
|
|
+
|
|
|
|
+let ENV_FILE_NAME = '';
|
|
|
|
+switch (process.env.NODE_ENV) {
|
|
|
|
+ case 'production_like':
|
|
|
|
+ ENV_FILE_NAME = '.env.production';
|
|
|
|
+ break;
|
|
|
|
+ case 'test':
|
|
|
|
+ ENV_FILE_NAME = '.env.test';
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ ENV_FILE_NAME = '.env';
|
|
|
|
+ break;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+dotenv.config({ path: process.cwd() + '/' + ENV_FILE_NAME });
|
|
|
|
+
|
|
// CORS when consuming Medusa from admin
|
|
// CORS when consuming Medusa from admin
|
|
const ADMIN_CORS = process.env.ADMIN_CORS || "http://localhost:7000,http://localhost:7001";
|
|
const ADMIN_CORS = process.env.ADMIN_CORS || "http://localhost:7000,http://localhost:7001";
|
|
|
|
|