-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load & serve config from filesystem during runtime (SERVER_CONFIG_PATH, UI_CONFIG_PATH) #377
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously this config was looked up from ethlance root folder under `config` and the files had to have specific name, e.g. `config/server-config-qa.edn` Now when COMPILING the project for release to non-dev environment e.g. prod or qa 2 ENV variables need to be set: 1. ETHLANCE_ENV=qa (or prod) 2. ETHLANCE_CONFIG_PATH=/absolute/path-to.edn
The contracts shouldn't be deployed to QA or prod during the automatic build process. This is because it costs money, it's quite rare that we change the contracts and also the contract address files (shared/src/ethlance/shared/smart_contracts_{qa,prod}.cljs) need to be committed to version control to maintain the addresses. There are ways for doing it via CI but as of now it's not worth the effort
Earlier the ui & server config was compiled into the JS bundle. Now: 1. server config gets loaded during runtime as specified by `SERVER_CONFIG_PATH` 2. ui config gets loaded by the server process as specified by `UI_CONFIG_PATH` - and served via `/config` endpoint on server http api The UI application running on browser needs to know where to load the config from. That's configured by ```edn :server-config {:url "http://d0x-vm:6300/config" :format :json} ```
f0890cb
to
8628b81
Compare
8628b81
to
eec53a2
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After these changes the server & ui config will be loaded during runtime. It is specified by environment variables given to the server process when its started:
UI config gets served by the server in JSON format via
/config
endpoint