https://discord.umbraco.com logo
#news
Title
# news
w

warrenbuckley

02/25/2022, 12:04 PM

https://www.youtube.com/watch?v=0LW3w55QuD0

⬇️ One for you @User & @User to avoid using hardcoded API URLs in your packages
n

Nik

02/25/2022, 12:34 PM
Just for v9
w

warrenbuckley

02/25/2022, 12:38 PM
Yep exactly Nik - just a hidden gem that I am not sure everyone is aware of. So just bring awarness to it And after seeing you & Paul use hardcoded URLs to controllers, I wanted to make sure you both was aware of the approach to make sure you package is more bullet proof
n

Nik

02/25/2022, 1:40 PM
yeah, its brilliant. so useful!
c

codesharepaul

02/25/2022, 1:42 PM
I wanted to reference the Umbraco path in my examine package in the Js controller. How do I do that? It didn’t seem to like Umbraco.Sys.ServerVariables.whatever
n

Nik

02/25/2022, 1:47 PM
what issue do you get?
w

warrenbuckley

02/25/2022, 3:08 PM
Yeh not sure I follow you @User ? What are you trying to do?
c

codesharepaul

02/25/2022, 4:34 PM
I just wanted to set a variable which had the umbraco path in case anyone changed it in their application. It’s in the server variables. When I tried to use the property on the JavaScript server variables it said it didn’t recognise the object Umbraco.Sys.ServerVariables so I can’t access it.
w

warrenbuckley

02/25/2022, 4:56 PM
Only available in the backoffice when logged in. You trying to use it frontend of project or…?!
c

codesharepaul

02/25/2022, 7:26 PM
No it was for the link the the full examine dashboard from my content app
w

warrenbuckley

02/25/2022, 9:49 PM
Do you get any of the Umbraco.Sys stuff in the browser console dev tools?
c

codesharepaul

02/26/2022, 12:09 PM
Yeah I get it in the browser no probs
w

warrenbuckley

02/26/2022, 4:45 PM
Would need to do a lunchtime debug session to see what’s up