Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sample-stack",
"version": "0.11.1",
"version": "0.11.2",
"private": true,
"homepage": "https://github.com/cdmbase/fullstack-pro#readme",
"bugs": {
Expand Down
15 changes: 5 additions & 10 deletions servers/frontend-server/src/config/public-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@ import { lowerCase } from 'lodash';
* This file opens up in public site, so make sure it is
* not dependent on any other file that compromises the security.
*/
const publicEnv = [
'NODE_ENV',
'GRAPHQL_URL',
'FACEBOOK_APP_ID',
'GA_ID',
'LOG_LEVEL',
];
const publicEnv = ['NODE_ENV', 'GRAPHQL_URL', 'FACEBOOK_APP_ID', 'GA_ID', 'LOG_LEVEL'];

const isBrowser = typeof window !== 'undefined';

if (!isBrowser) {
process.env.ENV_FILE !== null && require('dotenv').config({ path: process.env.ENV_FILE });
}
const base = (isBrowser ? ( window.__ENV__ || __ENV__) : process.env) || {};
const base = (isBrowser ? window.__ENV__ || (typeof __ENV__ !== 'undefined' && __ENV__) : process.env) || {};
const env: any = {};
for (const v of publicEnv) {
env[v] = base[v];
Expand All @@ -37,8 +31,9 @@ try {
logger.info('Process Update Success!');
} catch (e) {
logger.warn(e);
logger.info('Encountered above issue while running "global.process = process", will automatically try again in next render');

logger.info(
'Encountered above issue while running "global.process = process", will automatically try again in next render',
);
}
export const PUBLIC_SETTINGS: __PUBLIC_SETTINGS__ = {
apolloLogging: false,
Expand Down