H
Hono3mo ago
lucasp

how to use with hono WorkerEntrypoint

Hi, I'm using hono and cloudflare workers. I'm using 3 workers and I'd like to communicate with a 4th one that acts as a gateway, that is, that validates the token and redirects the requests to their respective workers. According to the cloudflare workers documentation, this should be done using service binding plus RPC so that they are private, but I don't know how to adapt it to hono. according to the documentation it should be like this
import { WorkerEntrypoint } from "cloudflare:workers";

export class WorkerB extends WorkerEntrypoint {
async add(a, b) { return a + b; }
}
import { WorkerEntrypoint } from "cloudflare:workers";

export class WorkerB extends WorkerEntrypoint {
async add(a, b) { return a + b; }
}
my hono app
import { Hono } from "hono";

const app = new Hono();

app.get("/", (c) => {
return c.text("Hello Hono!");
});

export default app;
import { Hono } from "hono";

const app = new Hono();

app.get("/", (c) => {
return c.text("Hello Hono!");
});

export default app;
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server