mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Migrate to host/id based seed node records
Instead of having one record per service, we configure the host and expect services to run on certain ports.
This commit is contained in:
+5
-4
@@ -5,8 +5,8 @@ export async function get(
|
||||
params: Record<string, any>,
|
||||
config: Config
|
||||
): Promise<any> {
|
||||
if (! config.seed.api) {
|
||||
throw new Error("Seed HTTP API unavailable");
|
||||
if (! config.seed.host) {
|
||||
throw new Error("Seed host unavailable");
|
||||
}
|
||||
|
||||
const query: Record<string, string> = {};
|
||||
@@ -14,9 +14,10 @@ export async function get(
|
||||
query[key] = val.toString();
|
||||
}
|
||||
|
||||
const base = config.seed.api.replace(/\/$/, "");
|
||||
const base = config.seed.host;
|
||||
const port = config.seed.port;
|
||||
const search = new URLSearchParams(query).toString();
|
||||
const baseUrl = `${base}/v1/${path}`;
|
||||
const baseUrl = `https://${base}:${port}/v1/${path}`;
|
||||
const url = search ? `${baseUrl}?${search}` : baseUrl;
|
||||
|
||||
let response = null;
|
||||
|
||||
Reference in New Issue
Block a user