hosting ASP.NET MVC 4 web api on IIS - failed to load resource -
i'm trying set api , test it, (but knowledge of asp.net mvc , iis limited). i'm using sample code provided @ http://www.asp.net/web-api/overview/creating-web-apis (sample: contact manager).
i uploaded provided files contactmanager folder (app_data, content, etc.) , set new website in iis ip 142.70.43.211 , home directory pointing local directory containing files.
the default.htm file loads fine, jquery ajax call returns error "failed load resource: server responded status of 404 (not found)".
at first, thought fact jquery get() call requesting "contacts" rather complete url, chrome's console shows me trying load "142.70.43.211/contacts" , failing...
edit: forgot upload "packages" folder provided...after doing this, console gives me error: "get 142.70.43.211/contacts 404 (not found)"...not different...
did miss step in setting up?
the webapiconfig.cs file shows routes defined follows:
config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.optional } ); which means expecting /142.70.43.211/api/contacts. check if views\home\index.html has reference paths "api/contacts" , not "contacts"
Comments
Post a Comment