Compare commits
1 Commits
f2d235d046
...
cb8722940e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb8722940e
|
@@ -26,11 +26,9 @@
|
||||
|
||||
npmDepsHash = "sha256-2XxcsvKeYp+SVBx6Z2uB/34qUr7AderMxXKjm/kS8F0=";
|
||||
|
||||
API_PORT = "3000";
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
PUBLIC_API_PORT="''${API_PORT}" npm run build
|
||||
npm run build
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
@@ -45,7 +43,7 @@
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Router Dashboard - A SvelteKit static web interface";
|
||||
license = licenses.agpl3Only;
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import type { NetworkStatus } from '$lib/types'
|
||||
import type { PageLoad } from './$types'
|
||||
import { PUBLIC_API_PORT } from '$env/static/public'
|
||||
|
||||
export const ssr = false
|
||||
|
||||
const API_PORT = import.meta.env.PUBLIC_API_PORT ?? '8080'
|
||||
|
||||
export const load: PageLoad = async ({ fetch, url }) => {
|
||||
const apiUrl = `${url.protocol}//${url.hostname}:${PUBLIC_API_PORT}`
|
||||
const apiUrl = `${url.protocol}//${url.hostname}:${API_PORT}`
|
||||
const response = await fetch(apiUrl)
|
||||
const networkStatus: NetworkStatus = await response.json()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user