The service works, but after start the service the browser opens the http://localhost:8088/ url instead of http://localhost:8088/api/metadata url. How can I setup the host for the correct metadata page?
That’s odd as app.UsePathBase("/api") should be registering middleware that does the same thing.
Anyway I’ve revisited this and looking to add an “official API” to make it easy to register the PathBase in ASP.NET Core Apps where the only thing you should need to do is specifying the PathBase when registering your AppHost, e.g:
I’ve also added deep support into all the UI server controls in Unified Navigation to auto include the PathBase if specified. Both Razor and #Script Pages now include a PathBase variable you can use to be able to generate links that can be used whether or not there’s a PathBase configured:
The API works, but the metadata page remains http://localhost:8088 at startup. If I type the full url http://localhost:8088/api the metadat page load correctly.
This is my DefaultRedirectPath setting: DefaultRedirectPath = "~/metadata"
Not exactly sure what you mean, if you host ServiceStack on a path it wont be handling requests to the base URL anymore.
If you want to you can add a catchall middleware after registering ServiceStack AppHost if you want to redirect any requests not handled by ServiceStack, e.g: