Closed reinux closed 1 year ago
Hi @reinux I believe if you need to append /api
to your endpoint, you can use a custom route builder for it:
let routeBuilder (typeName: string) (methodName:string) = $"/api/{typeName}/{methodName}"
Can you give this a try?
Oh, duh, that did it.
I was looking for withBaseUrl
, which exists in the Fable version but not the dotnet version. Should have noticed withRouteBuilder
anyway though, since it exists for the server builder as well.
Thanks!
This line uses the Uri(Uri, string) constructor, which drops the path part of the first Uri.
Which means that doing something like the following:
the
/api
part goes missing.Since this is how the System.Uri constructor is designed, I think the only solution would be to either construct the entire Uri manually from the base url parts, or to prepend the routeBuilder result with the path.