mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
code: nextjs,frontends,client (1 files)
This commit is contained in:
@@ -11,9 +11,16 @@ export interface DaemonRpcRequest {
|
||||
}
|
||||
|
||||
export async function callDaemon<T = unknown>(request: DaemonRpcRequest): Promise<T> {
|
||||
const headers: Record<string, string> = {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
if (process.env.DBAL_API_KEY) {
|
||||
headers['x-dbal-api-key'] = process.env.DBAL_API_KEY
|
||||
}
|
||||
|
||||
const response = await fetch(DEFAULT_DAEMON_URL, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
headers,
|
||||
body: JSON.stringify(request),
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user