Skip to content
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

[Question] SwaggerEndpoints configurations per enviroment #238

Closed
maxoizs opened this issue Oct 7, 2022 · 3 comments
Closed

[Question] SwaggerEndpoints configurations per enviroment #238

maxoizs opened this issue Oct 7, 2022 · 3 comments
Labels
waiting-8-days Closing after 8 days of waiting for the additional info requested.

Comments

@maxoizs
Copy link

maxoizs commented Oct 7, 2022

I have a question regarding SwaggerEndpoints, I'm using ocelot and swagger for ocelot, with configuration folder and so far it works fine, the issue is, in SwaggerEndpoint how do I mention that base URL should change per environment, I've it fixed for dev environment now, but I would like to push to qa and stage as well.
so ocelot.swaggerendpoints.json like that

{
  "SwaggerEndPoints": [
    {
      "Key": "ProductService",
      "Config": [
        {
          "Name": "Product Service",
          "Version": "v1",
          "Url": "https://service-dev.net/swagger/v1/swagger.json"
        }
      ]
    }
   ]
}

example I would like to be in QA environment like this https://service-qa.net/swagger/v1/swagger.json and stage https://service-stage.net/swagger/v1/swagger.json etc

do you guys add multi configs for all environments or do change that file on pipeline using yaml or do you override from code and how, or does the global configuration for ocelot work and how please ?

@Burgyn
Copy link
Owner

Burgyn commented Oct 8, 2022

Hi @maxoizs,

for these purposes I use the Service discovery, especially AppConfiguration (different appsettings.json for different environments).

SwaggerForOcelot can read documentation from services defined in by that providers. See documentation.

@Burgyn Burgyn added the waiting-8-days Closing after 8 days of waiting for the additional info requested. label Oct 8, 2022
@maxoizs
Copy link
Author

maxoizs commented Oct 10, 2022

@Burgyn thanks a lot , AppConfiguratoin as a service discovery worked very well so far, and appSettings is much easier to configure per environment especially that we were using docker, and replace a token within a docker image was a nightmare for me 😄 , thanks a lot for that.

@maxoizs maxoizs closed this as completed Oct 10, 2022
@Burgyn
Copy link
Owner

Burgyn commented Oct 10, 2022

I'm glad I could help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-8-days Closing after 8 days of waiting for the additional info requested.
Projects
None yet
Development

No branches or pull requests

2 participants