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 @@
/* global mapboxgl, turf */
const baseUrl = new URL(window.location.href).origin; // returns "http://localhost:8092"
// use `${baseUrl}/something`
const windowUrl = new URL(window.location.href);
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,
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