Deleted fetch syscall (now natively supported)
This commit is contained in:
@@ -11,7 +11,6 @@ import { EndpointHook, EndpointHookT } from "../hooks/endpoint";
|
||||
import { safeRun } from "../util";
|
||||
import knex from "knex";
|
||||
import { ensureTable, storeSyscalls } from "../syscalls/store.knex_node";
|
||||
import { fetchSyscalls } from "../syscalls/fetch.node";
|
||||
import { EventHook, EventHookT } from "../hooks/event";
|
||||
import { eventSyscalls } from "../syscalls/event";
|
||||
|
||||
@@ -54,7 +53,6 @@ safeRun(async () => {
|
||||
system.registerSyscalls([], eventSyscalls(eventHook));
|
||||
system.addHook(new EndpointHook(app, ""));
|
||||
system.registerSyscalls([], shellSyscalls("."));
|
||||
system.registerSyscalls([], fetchSyscalls());
|
||||
system.registerSyscalls([], storeSyscalls(db, "item"));
|
||||
app.listen(args.port, () => {
|
||||
console.log(`Plugbox server listening on port ${args.port}`);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import fetch, { RequestInfo, RequestInit } from "node-fetch";
|
||||
import { SysCallMapping } from "../system";
|
||||
|
||||
export function fetchSyscalls(): SysCallMapping {
|
||||
return {
|
||||
"fetch.json": async (ctx, url: RequestInfo, init: RequestInit) => {
|
||||
let resp = await fetch(url, init);
|
||||
return resp.json();
|
||||
},
|
||||
"fetch.text": async (ctx, url: RequestInfo, init: RequestInit) => {
|
||||
let resp = await fetch(url, init);
|
||||
return resp.text();
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user