Cool! Just signed it.
Best way to get base URL from client side JS
-
I'm in the middle of writing a NodeBB plugin. Is there anything immediately available within the client side JS that will allow me to get the base URL for ajax calls or should I simply take it from the window object?
Thanks
-
@CCob
config.relative_path
-
@PitaJ said in Best way to get base URL from client side JS:
config.relative_path
So would I simply take location.origin + config.relative_path as the root to the NodeBB install?
-
@CCob yep pretty much.
-
@PitaJ, is there a simple way to find the client IP, similar to config.relative_path?