Hello,
I’ve asked this question over at Stack Overflow, but I figured I bring it straight to the proverbial “horse’s mouth”. I’m sorry if this turns out to be something extremely basic, perhaps my Google-fu is failing me…
I’m building a self-host application in C# using Service Stack. I’d like the application to share content based on some configuration data.
During AppHost.Configure I’d like to read-in a configuration file and recursively share several directories. The directories may be local or shared folders depending on each element in the configuration.
For example, if my config looks like this:
[
{
"sourceId": "TEST1",
"contentPath": "\\\\nas01\\files"
},
{
"sourceId": "TEST2",
"contentPath": "d:\\files"
}
]
I’d like the directories to be recursively accessible like this:
http://localhost/TEST1/....
http://localhost/TEST2/....
The content stored here is media, so I want to be able to benefit from ServiceStack’s Partial support. Also the content of these directories change quite often so I don’t want to map individual files on startup.
Reading the config file is no problem, really, I just want to know the right way to map these directories so I can use the built-in static handling capabilities of ServiceStack.
I’ve done a bunch of searching, here on the forum, on the Internet, and within the documentation but I’m at a loss as to how to do something which seems kind of simple. My question is:
What’s the right way, in Service Stack, to map a static content directory at run-time?
Many thanks!
-Z