diff options
Diffstat (limited to 'src/lib.ts')
| -rw-r--r-- | src/lib.ts | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -7,7 +7,7 @@ import {LayoutOptions} from './layout'; import {getBreakpoint, Breakpoint, getScrollBarWidth, onTouchDevice} from './util'; // For server requests -const SERVER_URL = window.location.href + 'data' +const SERVER_URL = (new URL(window.location.href)).origin + '/data' export async function queryServer(params: URLSearchParams){ // Construct URL let url = new URL(SERVER_URL); @@ -18,7 +18,7 @@ export async function queryServer(params: URLSearchParams){ let response = await fetch(url.toString()); responseObj = await response.json(); } catch (error){ - console.log(`Error with querying ${url}: ${error}`); + console.log(`Error with querying ${url.toString()}: ${error}`); return null; } return responseObj; |
