I have a web application that has regular webpages and an API. the regular controllers are in Controllers/, the API controllers are in Controllers/API.
On one of my views I can call
$.getJSON("/API/PRAXA/FO")
but that only works in development. In production, the application is in a subdirectory, so I would have to call
$.getJSON("/DMR/API/PRAXA/FO")
How can I determine this properly at run-time, so it works in both development and production?
I tried using
@Html.RouteLink("hiddenLink", "DefaultApi", new { action = "FO", controller = "PRAXA" }, new { id = "hiddenLink" })
but its href
attribute is giving me null in both environments.