Update hazard list API to use relative URLS. (Much better for subdirectory hosting!)
Some checks are pending
build-docker / Build Image (push) Waiting to run
Some checks are pending
build-docker / Build Image (push) Waiting to run
This commit is contained in:
parent
e2f7475464
commit
31c0aced4a
2 changed files with 4 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import STATUS from './status.mjs';
|
||||
import WeatherDisplay from './weatherdisplay.mjs';
|
||||
import { registerDisplay } from './navigation.mjs';
|
||||
import { withBasePath } from './utils/base-path.mjs';
|
||||
|
||||
class HazardList extends WeatherDisplay {
|
||||
constructor(navId, elemId) {
|
||||
|
|
@ -14,7 +15,7 @@ class HazardList extends WeatherDisplay {
|
|||
|
||||
try {
|
||||
// Fetch hazard history from backend
|
||||
const response = await fetch('/api/hazard-history');
|
||||
const response = await fetch(withBasePath('api/hazard-history'));
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue