Skip to content

Latest commit

 

History

History

demo_redirect_path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Base setup

Use the ASPNET Core rewrite capabilities to control ServiceStack routes and endpoints.

About this demo

Leverages URL Rewriting Middleware in ASP.NET Core to serve a ServiceStack API on different endpoints.

I find this helpful when for example I need to develop an API that runs both as:

Run this demo

Now run the dotnet app

dotnet restore
dotnet run # or dotnet watch

Notes

The ServiceStack implementation is running at the "ROOT" path of the website, but using these rewrite capabilities, the ServiceStack api is served from "/api" and the Swagger documentation is served from "/docs".

The following URLs render the same thing:

Mapped URL ServiceStack URL
/api /metadata
/docs /swagger-ui/
/api/{anything} /{servicestack_route}