You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the top level of descriptor files has the keys :activated-apis, :datomic-uri, and :descriptor. Two of these are much more like environment-specific configuration, specifically :activated-apis and :datomic-uri.
Also, I've found it challenging to get the Datomic URI from the descriptor file to use in any other non-Vase interceptors in my application. (The Vase template doesn't offer any place to get access to the connection that's created for the standard DB interceptor.)
Proposal
This proposal has three parts:
Restrict the descriptor file to just the contents that are currently under the top-level :descriptor key.
Adjust the Vase template to look for a separate config.edn file for the system configuration.
Adjust the top-level API functions vase/routes and vase/descriptor-facts to just take what is now the contents of the :descriptor key. vase/routes should take one new parameter with a map for configuration.
Considerations
As a library, Vase should be silent on the issue of how applications will load their config. It should make no assumptions about whether config comes from a file, environment variables, ZooKeeper, or anything else. When config is needed, Vase functions should just accept a maplike value.
This is a breaking change, so it would be better to do this before we cut release 1.0.
The text was updated successfully, but these errors were encountered:
The top-level vase functions accept multiple descriptors to be passed in, allowing someone to define services (via :descriptor) and then use different "descriptor chunks" per environment, which specify DB info, activated apis, etc. This approach is more or less the combination of your (2) item and "Considerations" section (since the top-level Vase API is all value-oriented).
You point out one problem I've been thinking about for some time now - seeing/accessing descriptor values, from within application pieces (action literals, interceptors, etc). I think this needs to be addressed and I have some ideas.
Description
Right now, the top level of descriptor files has the keys
:activated-apis
,:datomic-uri
, and:descriptor
. Two of these are much more like environment-specific configuration, specifically:activated-apis
and:datomic-uri
.Also, I've found it challenging to get the Datomic URI from the descriptor file to use in any other non-Vase interceptors in my application. (The Vase template doesn't offer any place to get access to the connection that's created for the standard DB interceptor.)
Proposal
This proposal has three parts:
:descriptor
key.config.edn
file for the system configuration.vase/routes
andvase/descriptor-facts
to just take what is now the contents of the:descriptor
key.vase/routes
should take one new parameter with a map for configuration.Considerations
As a library, Vase should be silent on the issue of how applications will load their config. It should make no assumptions about whether config comes from a file, environment variables, ZooKeeper, or anything else. When config is needed, Vase functions should just accept a maplike value.
This is a breaking change, so it would be better to do this before we cut release 1.0.
The text was updated successfully, but these errors were encountered: