More cards
This commit is contained in:
@@ -51,7 +51,7 @@ const stop = () => { stopping = true; engine.close(); };
|
||||
process.once('SIGINT',stop); process.once('SIGTERM',stop);
|
||||
async function api(path: string, body?: unknown) {
|
||||
const response = await fetch(new URL(path,endpoint), { method: body ? 'POST' : 'GET', redirect:'error',
|
||||
signal: AbortSignal.timeout(15000), headers: body ? {'Content-Type':'application/json'} : {}, body: body ? JSON.stringify(body) : undefined });
|
||||
signal: AbortSignal.timeout(30000), headers: body ? {'Content-Type':'application/json'} : {}, body: body ? JSON.stringify(body) : undefined });
|
||||
const text = await response.text();
|
||||
if (text.length > 131072) throw new Error('Node response too large');
|
||||
const data = JSON.parse(text);
|
||||
|
||||
Reference in New Issue
Block a user