c# - How to publish assets using web-api -
i using mvc web api server application generating client data. in addition, want publish collection of javascript, xap (silverlight) , xml files client-side application. currently, have project structure in directories mixed through .net implementation code (what not like), client app uses uris request these files can not changed. nevertheless, want separate client data server application implementation in different folder.
therefore, there way store client data in separate folder, e.g.
- /clientdata/javascript
- /clientdata/xap
- /clientdata/xml
- /clientdata/...
in project, while still being able access these files using uris like
- /javascript
- /xap/
- /xml/
which urls used client app , again can not changed.
this main method of global.asax
arearegistration.registerallareas(); routetable.routes.maproute( name: "default", url: string.empty, defaults: new { controller = "home", action = "index", id = urlparameter.optional }, namespaces: new[] { "tcmsimulator.controllers" } ); var config = new microsoft.applicationserver.http.httpconfiguration(); routetable.routes.mapserviceroute<resourcesservice>("resources/", config); routetable.routes.mapserviceroute<publicresourcesservice>("publicresources/",config); routetable.routes.mapserviceroute<monitorservice>("monitor/", config);
is there way add folder redirect routing table, such virtual folder in uri redirected filesystem folder? can done using modrewrite in apache? seems simple problem, have not found solution in web api.
thanks in advance!
i recommend using attribute routing. more understandable. can see examples of multiple routes mapped single resource.
Comments
Post a Comment