question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Placeholder in DownstreamHostAndPorts

See original GitHub issue

Is it possible to achieve this with Ocelot?

Environment Variables ApiName : account EnvironmentName : dev

{
    "Routes": [
        {
            "DownstreamPathTemplate": "/{everything}",
            "DownstreamScheme": "http",
            "UpstreamPathTemplate": "/{everything}",
            "UpstreamHttpMethod": ["Get", "Put", "Delete", "Post"],
            "DownstreamHostAndPorts": [{
                    "Host": "api.{ApiName}.{EnvironmentName}",
                    "Port": 80
                }
            ]
        }
    ],
    "GlobalConfiguration": {
        "BaseUrl": "https://localhost:8080"
    }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gao-arturcommented, Jun 29, 2023

You can easily add it yourself https://stackoverflow.com/a/63601248/2557855

1reaction
jeffersantosscommented, Apr 27, 2023

Can this be achieved on the current Ocelot version?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ocelot placeholder for downstream host
I want to change the Host in the DownstreamHostAndPorts at runtime as by this time from grabbing the claims out of the jwt...
Read more >
Routing — Ocelot 1.0.0 documentation
The placeholder variable needs to be present in both the DownstreamPathTemplate and UpstreamPathTemplate properties. When it is Ocelot will attempt to ...
Read more >
Ocelot Documentation
Ocelot is aimed at people using .NET running a micro services / service orientated architecture that need a unified.
Read more >
Developers - Placeholder value does not correctly replace when ...
The specified placeholder variable value should be replaced within the Downstream URI provided in the UpstreamPathTemplate and DownStreamPathTemplate.
Read more >
Implementing an API Gateway in ASP.NET Core with Ocelot
Learn what an API Gateway is and how to build yours in ASP.NET Core by using Ocelot.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found