Configure from code instead of config files #1892
-
Expected Behavior / New FeatureIs there any possibility to configure Ocelot from code, maybe in Startup.cs? If not, is it in the roadmap, are you intending to add this in the future? Actual Behavior / Motivation for New FeatureRoutes cannot be configured from the code, only from config files. Steps to Reproduce the ProblemFollow any setup guide from documentation. Specifications
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
We did that long time ago by providing a custom All we did is implemented our own version of it (old code but will give you a basic idea): |
Beta Was this translation helpful? Give feedback.
-
@RobertHajbok Hi Robert! public static IConfigurationBuilder AddOcelot(this IConfigurationBuilder builder, FileConfiguration fileConfiguration) {} The link is here Hope it helps! |
Beta Was this translation helpful? Give feedback.
@RobertHajbok Hi Robert!
Since version 20.0 we have new DI extension for injection of a
FileConfiguration
object being constructed manually from any storages and sources including databases.Signature:
The link is here
Commit: 4d245ec
Hope it helps!