@equinor/opt-serve v6.16.1
@equinor/opt-serve
Nodejs server for OPT applications.
Production Server
In order to run a production server this package expects that the application is build using the dependency @equinor/opt-dev.
Once the application is build a production server can be start using the cli script:
// package.json
"scripts": {
    "start": "opt-serve"
}Advanced Configuration
You can adjust various development and production settings by setting environment variables in your shell or with .env.
Note: To create custom environment variables, you must begin with
REACT_APP_. Any other variables exceptNODE_ENVwill be ignored to avoid accidentally exposing a private key on the machine that could have the same name. Changing any environment variables will require you to restart the development server if it is running.
The list of the environment variables are:
Base server configuration:
- HTTPS: if the webpack must use https, only use it for development,- falseby default.
- HOST: the host where to execute the application.- 0.0.0.0by default.
- PORT: the port where to execute the application.- 3000by default.
- COOKIE_SECRET: the cookie secret used by the express server, if non is provided it will generate a random one.
- SESSION_SECRET: the session secret used by the express server, if non is provided it will generate a random one.
- API_URL: the api url.
Active directory configuration:
- ADAL_ENABLED: Deprecated Enable ADAL instead of MSAL, this option should not be used and is only there to keep backward compatibility. It will be removed in future versions.
- AD_ROUTES_ENABLED: enable the Windows Azure Active Directory Authentication server routes.- falseby default.
- AD_CLIENT_ID: the Azure Active Directory Authentication client id.
- AD_CLIENT_SECRET: the Azure Active Directory Authentication client secret.
- AD_TENANT: the Azure Active Directory Authentication tenant (dedicated and trusted Azure Active Directory's instance).
- AD_RESOURCE: the Azure Active Directory Authentication resource.
Browser history:
- HISTORY_API_MIDDLEWARE: Enable the history api middleware. Use it if you are using a- BrowserHistory.- falseby default.
Azure Application Insights key:
- APP_INSIGHTS_INSTRUMENTATION_KEY: Azure Application Insights key, see more on appinsights. This option is useful if you are using the skeleton from create-opt-app, if you are not using it, this option is probably useless and you can safely remove it.
Webpack configuration:
- IMAGE_INLINE_SIZE_LIMIT: The limit to get the images using the- url-loader.- 10000by default. By default, images smaller than 10,000 bytes are encoded as a data URI in base64 and inlined in the CSS or JS build artifact. Set this to control the size limit in bytes. Setting it to 0 will disable the inlining of images.
- GENERATE_SOURCEMAP: if the webpack should generate the source map files when compile to production.- trueby default. When set to- false, source maps are not generated for a production build. This solves out of memory (OOM) issues on some smaller machines.
- INLINE_RUNTIME_CHUNK: If the runtime script need to be embed into to the index.html.- trueby default. By default, the runtime script will be embed into the- index.htmlduring the production build. When set to- false, the script will not be embedded and will be imported as usual. This is normally required when dealing with CSP.
- DISABLE_NEW_JSX_TRANSFORM: Disables the new JSX transform introduced in React 17 and backported to React 16.14.0, 15.7.0, and 0.14.10.- falseby default.
- ESLINT_NO_DEV_ERRORS: if the webpack should emit errors as warnings.- falseby default. When set to- true, ESLint errors are converted to warnings during development. As a result, ESLint output will no longer appear in the error overlay.
- DISABLE_ESLINT_PLUGIN: Disable the eslint webpack plugin.- falseby default.
- FAST_REFRESH: Whether or not react-refresh is enabled.- trueby default.
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago