This project was generated with Angular CLI. Please check the documentation for all the configuration and CLI commands.
Configure environment variables in src > environments.ts file
export const environment = {
production: true/false,
netlifyEnvUrl: "https://..../.netlify/functions/get-env-variables",
libConfig: {
endpoint: 'https://...../pages',
smEndPoint: 'https://....',
smSuggestionEndPoint: 'https://suggest.xyzz.com/api/',
accountId : "1234",
domainKey : "abc_123",
authKey : "etdr235dfh"
},
appConfig: {
defaultLoadingTime: 2 // in seconds
}
};
npm ci
npm start
Navigate to http://localhost:3000/
. The app will automatically reload if you change
any of the source files.
For more on components and environment varaibles check out the Bloomreach Spartacus Library documentation.
Configure environment variables(as here) in src > environments.prod.ts file
npm ci
npm run build
- Deploy Netlify function along with App distribution to Netlify
- Netlify provides an endpoint of the deployed function to access the environment variables
- Copy the endpoint URL from Netlify functions dashboard and add it to "netlifyEnvUrl" property in the environment file as shown above
- Use 'brx_' as prefix while setting ENV variables names in Netlify (Eg: brx_endpoint)
- If adding/editing environment variables in Netlify, you'll need to rebuild and re-deploy the App to get the latest value of environment variables