Enable configuring SDK in the ENV

This commit is contained in:
Kimmo Puputti 2017-02-27 10:09:27 +02:00
parent 11b8a114a2
commit 6d7e35fb61

View file

@ -1,10 +1,16 @@
const env = process.env.NODE_ENV;
const dev = env !== 'production';
const config = {
env,
dev,
sdk: { clientId: '08ec69f6-d37e-414d-83eb-324e94afddf0', baseUrl: 'http://localhost:8088' },
};
// To pass environment variables to the client app in the build
// script, react-scripts (and the sharetribe-scripts fork of
// react-scripts) require using the REACT_APP_ prefix to avoid
// exposing server secrets to the client side.
const sdkClientId = process.env.REACT_APP_SHARETRIBE_SDK_CLIENT_ID ||
'08ec69f6-d37e-414d-83eb-324e94afddf0';
const sdkBaseUrl = process.env.REACT_APP_SHARETRIBE_SDK_BASE_URL || 'http://localhost:8088';
// NOTE: only expose configuration that should be visible in the
// client side, don't add any server secrets in this file.
const config = { env, dev, sdk: { clientId: sdkClientId, baseUrl: sdkBaseUrl } };
export default config;