I already have a web application in the root folder of my website. (e.g. http://cassapi.gear.host). Now I want to add one MVC web API application in a subfolder inside the 'wwwroot' folder, so that I can access my home controller something like "http://cassapi.gear.host/DOTAPI/api/values" without troubling the website in the 'wwwroot' folder.
Note: It's working fine when I publish this MVC application in the root folder.
My web.config is like this :-
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
My root config:-
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "DOTAPI/{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
i am a windows application developer and new in MVC. so, please look into this and help me.
Currently , when i am calling the url "http://cassapi.gear.host/DOTAPI/" it shows "You do not have permission to view this directory or page."