This section is for developers contributing to the library or running the demo application locally.
You must build the library first because the test app consumes the built artifact (dist/).
# Build the library in production mode
npm run ng -- build ngx-config-orchestrator
The demo-app is a demo application included in the workspace to verify functionality.
# Serve the test application
npm run ng -- serve demo-app
-
URL:
http://localhost:4200 -
Verify: Open the URL. You should see the configuration values displayed on the screen.
-
Hot Test: Modify
projects/demo-app/src/assets/app-settings.manifest.jsonwhile the server is running and refresh the browser to see changes instantly.
To run unit tests for the library:
npm run ng -- test ngx-config-orchestrator
If you are using Angular Universal (SSR), the library is designed to handle it gracefully.
-
Server: The HTTP request to fetch the manifest is skipped on the server to prevent
NetworkError(since Node.js doesn't understand relative paths like./assets). It returns an empty object or your defaultenvironmentvalues. -
Browser: The browser fetches the real JSON file during hydration, ensuring the client has the correct runtime configuration.
License MIT © Xhani Manolis Trungu