lucasp
lucasp
Explore posts from servers
CDCloudflare Developers
Created by lucasp on 10/4/2024 in #pages-help
Error cache
hello im getting this error, someone knows whats happend?
import { auth } from '@/auth'
import { getUser } from '@/client/services/user.service'
import Home from '@/components/pages/Home'
import { redirect } from 'next/navigation'

export const runtime = 'edge'

export default async function Main() {
const session = await auth()

const user = await getUser(session?.user?.localId ?? '')

if (!user?.cargo_giver) redirect('/profile')

return <Home />
}
import { auth } from '@/auth'
import { getUser } from '@/client/services/user.service'
import Home from '@/components/pages/Home'
import { redirect } from 'next/navigation'

export const runtime = 'edge'

export default async function Main() {
const session = await auth()

const user = await getUser(session?.user?.localId ?? '')

if (!user?.cargo_giver) redirect('/profile')

return <Home />
}
server side exception and when check logs "logs": [ { "message": [ "Error: The 'cache' field on 'RequestInitializerDict' is not implemented." ],
1 replies
CDCloudflare Developers
Created by lucasp on 9/26/2024 in #workers-help
any way to use the binding with hono without passing the service url?
I am using several workers and I would like to use one as a gateway and communicate with all of them through service bindings, but is there a way to use the service binding without passing the full URL of the other service? I attach the example
const app = new Hono<{ Bindings: { USERS_WORKER: Fetcher } }>();

app.get("/", async (c) => {
const res = await c.env.USERS_WORKER.fetch("/");

const data = await res.json();

console.log(data);

return c.text("Hello Hono!");
});
const app = new Hono<{ Bindings: { USERS_WORKER: Fetcher } }>();

app.get("/", async (c) => {
const res = await c.env.USERS_WORKER.fetch("/");

const data = await res.json();

console.log(data);

return c.text("Hello Hono!");
});
i get this error ✘ [ERROR] TypeError: Invalid URL: / only works if i set the url like this const res = await c.env.USERS_WORKER.fetch("http://localhost:8787/"); But since I have several workers, I'd need to define many variables and I'd like to know if there's a way to save myself that step.
8 replies
HHono
Created by lucasp on 9/3/2024 in #help
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;
1 replies
CDCloudflare Developers
Created by lucasp on 9/2/2024 in #workers-help
problem with d1 locally
No description
3 replies
DTDrizzle Team
Created by lucasp on 8/21/2024 in #help
help with relations
No description
1 replies