I am in the process of converting my stand-alone home grown web server to use ServiceStack for serving all pages and resources.
I see from this question
Serving a static file with servicestack
that it is easy to serve a single static file with Service Stack.
In my home grown implementation, after checking to see if a URL matches any particular handler (equivalent to ServiceStack routes), the default handler then checks for a static file in its HttpData directory to serve matching the URL.
If that file does not exist, it then generates a 404 error.
What is the best pattern to use with ServiceStack to serve files from the file system if no other service is matched? Note that I am using it in standalone mode without IIS.
These files can be HTML, PNG, JS, and a small handful of other content types.
Note: I see the ServiceStack.Razor package may assist my requiredments, but I cannot find the documentation on it. I will put in a separate question about that.
Edit: I found a reference in this question
Create route for root path, '/', with ServiceStack
indicating
Register a
IAppHost.CatchAllHandlers
- This gets called for un-matched requests.
So far, I have not found any documentation or example on how to to this registration. Note: I am running stand-alone, so it needs to be done in C#, not with XML.