Cleanup and progress

This commit is contained in:
Zef Hemel
2022-03-21 15:21:34 +01:00
parent 7e591c6f44
commit a916088215
31 changed files with 707 additions and 143 deletions
+15 -4
View File
@@ -36,8 +36,16 @@
"events": {
"page:click": ["taskToggle", "clickNavigate"],
"editor:complete": ["pageComplete"],
"page:index": ["indexLinks"]
}
"page:index": ["indexLinks"],
"load": ["welcome"]
},
"endpoints": [
{
"method": "GET",
"path": "/",
"handler": "endpointTest"
}
]
},
"functions": {
"indexLinks": {
@@ -76,8 +84,11 @@
"toggle_h2": {
"path": "./markup.ts:toggleH2"
},
"server_test": {
"path": "./server.ts:test"
"endpointTest": {
"path": "./server.ts:endpointTest"
},
"welcome": {
"path": "./server.ts:welcome"
}
}
}
+14 -4
View File
@@ -1,5 +1,15 @@
import { syscall } from "./lib/syscall";
export function test() {
console.log("I'm running on the server!");
return 5;
import { EndpointRequest, EndpointResponse } from "../../plugbox/endpoints";
export function endpointTest(req: EndpointRequest): EndpointResponse {
console.log("I'm running on the server!", req);
return {
status: 200,
body: "Hello world!",
};
}
export function welcome() {
for (var i = 0; i < 10; i++) {
console.log("Welcome to you all!!!");
}
}