How to implement routing with slug variable
In Blazor, I'm looking for a way to implement routing from a slug e.g. myapp.com/{slug}. Something similar to what Github is doing e.g. https://github.com/dotnet/roslyn. Each organization in my app has a dedicated unique slug to be able to bookmark the url for easy access. I have an API that needs an x-organization-id in the header that represent the current organization, matching the slug. My api client is configured to use the blazor server as a proxy when the interactivity is WASM and calls the api directly when the interactivity is server. This part is working great. Should I do all my calls with a slug in the url from Blazor WASM -> Blazor Server (Proxy) -> API or with a translation from slug to id from the proxy to API? I have the feeling it is better for the API to used an ID. How should I do this?
0 Replies