15 lines
430 B
TypeScript
15 lines
430 B
TypeScript
|
const serviceMap: { [id: string]: string } = {
|
||
|
interactive: "https://co.solsynth.dev",
|
||
|
identity: "https://id.solsynth.dev"
|
||
|
}
|
||
|
|
||
|
export async function request(service: string, input: string, init?: RequestInit) {
|
||
|
const url = buildRequestUrl(service, input)
|
||
|
return await fetch(url, init)
|
||
|
}
|
||
|
|
||
|
export function buildRequestUrl(service: string, input: string) {
|
||
|
const prefix = serviceMap[service] ?? ""
|
||
|
return prefix + input
|
||
|
}
|