mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Created a environment variable and using it when creating sdk instances.
This commit is contained in:
parent
0ebd799c56
commit
020c81103d
3 changed files with 7 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ const PORT = process.env.PORT || 4000;
|
|||
const CLIENT_ID = process.env.REACT_APP_SHARETRIBE_SDK_CLIENT_ID ||
|
||||
'08ec69f6-d37e-414d-83eb-324e94afddf0';
|
||||
const BASE_URL = process.env.REACT_APP_SHARETRIBE_SDK_BASE_URL || 'http://localhost:8088';
|
||||
const USING_SSL = process.env.REACT_APP_SHARETRIBE_USING_SSL === 'true';
|
||||
const ENFORCE_SSL = process.env.SERVER_SHARETRIBE_ENFORCE_SSL === 'true';
|
||||
const TRUST_PROXY = process.env.SERVER_SHARETRIBE_TRUST_PROXY || null;
|
||||
const app = express();
|
||||
|
|
@ -97,6 +98,7 @@ app.get('*', (req, res) => {
|
|||
clientId: CLIENT_ID,
|
||||
req,
|
||||
res,
|
||||
secure: USING_SSL,
|
||||
});
|
||||
|
||||
const sdk = sharetribeSdk.createInstance({
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ const currency = process.env.REACT_APP_SHARETRIBE_MARKETPLACE_CURRENCY || 'USD';
|
|||
// Sentry DSN (Data Source Name), a client key for authenticating calls to Sentry
|
||||
const sentryDsn = process.env.REACT_APP_PUBLIC_SENTRY_DSN;
|
||||
|
||||
// If webapp is using SSL (i.e. it's behind 'https' protocol)
|
||||
const usingSSL = process.env.REACT_APP_SHARETRIBE_USING_SSL === 'true';
|
||||
|
||||
// Currency formatting options.
|
||||
// See: https://github.com/yahoo/react-intl/wiki/API#formatnumber
|
||||
//
|
||||
|
|
@ -213,6 +216,7 @@ const config = {
|
|||
siteTwitterHandle,
|
||||
facebookAppId,
|
||||
sentryDsn,
|
||||
usingSSL,
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ if (typeof window !== 'undefined') {
|
|||
const sdk = createInstance({
|
||||
clientId: config.sdk.clientId,
|
||||
baseUrl: config.sdk.baseUrl,
|
||||
secure: config.usingSSL,
|
||||
typeHandlers: [
|
||||
{
|
||||
type: BigDecimal,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue