diff --git a/deno.json b/deno.json index 5606afe..951c33c 100644 --- a/deno.json +++ b/deno.json @@ -5,6 +5,6 @@ "start": "deno run -A --unstable-kv main.ts", "dev": "deno run -A --unstable-kv --watch main.ts", "build": "deno run -A build.ts", - "deploy": "npm create wisp -- deploy -y --spa --path ./dist --site random did:plc:dfl62fgb7wtjj3fcbb72naae" + "deploy": "deno x npm:wispctl deploy -y --spa --path ./dist --site random did:plc:dfl62fgb7wtjj3fcbb72naae" } } diff --git a/index.html b/index.html index ec2cf15..aeaca82 100644 --- a/index.html +++ b/index.html @@ -55,8 +55,10 @@ if (!r.ok) throw new Error(`server error (T_T): ${r.status}`); return r.json(); }) - .then(({ domainUrl, fallbackUrl }) => { - const href = domainUrl ?? fallbackUrl; + .then(({ domains, fallbackUrl }) => { + domains = domains.map(d => `https://${d}`); + const preferred = domains.filter(d => !d.endsWith("wisp.place")); + const href = (preferred.length > 0 ? preferred : domains)[0] ?? fallbackUrl; const a = document.getElementById("url"); a.href = href; a.textContent = href;