Basic ghost plugin

This commit is contained in:
Zef Hemel
2022-04-09 14:28:41 +02:00
parent 6ebf8e7f15
commit 8fafd1cd4a
19 changed files with 594 additions and 53 deletions
+5 -1
View File
@@ -19,6 +19,8 @@ import { EventedSpacePrimitives } from "../common/spaces/evented_space_primitive
import { Space } from "../common/spaces/space";
import { safeRun } from "../webapp/util";
import { createSandbox } from "../plugos/environments/node_sandbox";
import { jwtSyscalls } from "../plugos/syscalls/jwt";
import { fetchSyscalls } from "../plugos/syscalls/fetch.node";
export class ExpressServer {
app: Express;
@@ -65,6 +67,8 @@ export class ExpressServer {
system.registerSyscalls([], spaceSyscalls(this.space));
system.registerSyscalls([], eventSyscalls(this.eventHook));
system.registerSyscalls([], markdownSyscalls());
system.registerSyscalls([], fetchSyscalls());
system.registerSyscalls([], jwtSyscalls());
system.addHook(new EndpointHook(app, "/_/"));
this.space.on({
@@ -220,7 +224,7 @@ export class ExpressServer {
return res.send(`Plug ${plugName} not found`);
}
try {
console.log("Invoking", name, "with args", args);
console.log("Invoking", name);
const result = await plug.invoke(name, args);
res.status(200);
res.send(result);