(function (ns, $) { 'use strict'; function request(path) { return $.ajax({ url: ns.Config.apiBase + path, method: 'GET', dataType: 'json', cache: false }); } ns.Api = { health: () => request('/health'), routes: position => request('/routes' + (position ? `?lat=${encodeURIComponent(position.lat)}&lon=${encodeURIComponent(position.lon)}&radiusKm=${ns.Config.routeRadiusKm}` : '')), route: id => request(`/routes/${encodeURIComponent(id)}`) }; }(globalThis.Wegwichtel, globalThis.jQuery));