feat(env): add NEXT_PUBLIC_NODE_ENV

This commit is contained in:
Aminejv 2021-08-09 16:03:52 +01:00
parent edbd3b5e5a
commit 4f1b0d951c
4 changed files with 7 additions and 4 deletions

View File

@ -72,6 +72,7 @@ PUBSUB_SECRET=pKLO4lbzdMrhAFKwPo9bnmq03bxQrtu3
NEXT_PUBLIC_URI_SHOVEL=http://localhost:4242
NEXT_PUBLIC_URI_FIJI=ws://localhost:6464
NEXT_PUBLIC_URI_LENS=http://localhost:1313
NEXT_PUBLIC_NODE_ENV=development
```
### Setup pubsub server

View File

@ -1,5 +1,7 @@
export const NODE_ENV = process.env.NEXT_PUBLIC_NODE_ENV;
//NOTE(amine): feature flags
export const ACTIVITY_FEATURE_FLAG = !!process.env.NEXT_PUBLIC_ACTIVITY_FEATURE_FLAG;
export const ACTIVITY_FEATURE_FLAG = NODE_ENV === "development" || NODE_ENV === "staging";
// NOTE(jim): External servers
export const URI_SHOVEL = process.env.NEXT_PUBLIC_URI_SHOVEL;

View File

@ -3,7 +3,7 @@ import * as Environment from "~/node_common/environment";
import configs from "~/knexfile";
import knex from "knex";
const envConfig = configs[Environment.NODE];
const envConfig = configs[Environment.NODE_ENV];
const Database = knex(envConfig);
export default Database;

View File

@ -1,6 +1,6 @@
/* eslint-disable prefer-destructuring */
export const NODE = process.env.NODE_ENV || "development";
export const IS_PRODUCTION = NODE === "production";
export const NODE_ENV = process.env.NEXT_PUBLIC_NODE_ENV;
export const IS_PRODUCTION = NODE_ENV === "production";
export const PORT = process.env.PORT || 1337;
export const SOURCE = process.env.SOURCE;