Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I wan't to replace my hardcoded urls in my angular services with something more dynamic and found the our article on Server variables & URLs
I've added a new eventhandler and implemented the Parsing method with the custom routes and to a dictionary item with the name of my package.
dictionary.Add("package_name", new Dictionary<string, object>
When calling the Umbraco.Sys.ServerVariables["package_name"] the added variables show up.
I was hoping I could use umbRequestHelper.getApiUrl to retrieve the urls, in my angular code, but after looking in the source code I see the getApiUrl is hardcoded to only look in Umbraco.Sys.ServerVariables["umbracoUrls"].
So my question is, what is the correct way to have umbRequestHelper look for my custom routes in Umbraco.Sys.ServerVariables["package_name"]?
For now I've added my own service with a literal copy of getApiUrl that looks in the custom Umbraco.Sys.ServerVariables["package_name"], so my code works but it feels hacky.
I’ve done it the same way.
Haven’t seen a more elegant solution.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted