1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { currentState } from "https://esm.town/v/LavaC/currentState";
import { set } from "https://esm.town/v/std/set?v=11";
export const eventHandle = async (req: Request) => {
const { Hono } = await import("npm:hono");
const app = new Hono();
app.get("/set", async (c) => {
const process_name = c.req.query("process_name") || "";
// console.log(c.req);
await set("currentState", process_name);
return c.text("state set to " + process_name);
});
app.get(
"/get",
(c) => c.text("current state is" + currentState),
);
return app.fetch(req);
};