Commit b3fb3f80 authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

Fix baseUrl for localhost or server instances

parent 28ec3d65
...@@ -7,8 +7,11 @@ ...@@ -7,8 +7,11 @@
/* global mapboxgl, turf */ /* global mapboxgl, turf */
const baseUrl = new URL(window.location.href).origin; // returns "http://localhost:8092" const windowUrl = new URL(window.location.href);
// use `${baseUrl}/something` const baseUrl = windowUrl.hostname == "localhost" ?
`${windowUrl.origin}` : // returns "http://localhost:8092"
`${windowUrl.origin}/aire-cdmx`; // returns "http://servername/aire-cdmx"
// use `${baseUrl}/something`
let cdmx, estaciones, ozono, fechas, let cdmx, estaciones, ozono, fechas,
slider = document.getElementById("slider"), slider = document.getElementById("slider"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment