Gg
Gg
Explore posts from servers
HHono
Created by Gg on 8/27/2024 in #help
Sharing the app type from my hono api to my client in a monorepo
I'm trying to share types between my Hono API and Svelte app. Currently doing this:
// Hono app - apps/api/src/index.ts
import { Hono } from "hono";
const app = new Hono()
.get("/", ...
...

export default app;
export type AppRouter = typeof app;
// Hono app - apps/api/src/index.ts
import { Hono } from "hono";
const app = new Hono()
.get("/", ...
...

export default app;
export type AppRouter = typeof app;
// Svelte app - apps/web/...
import { hc } from "hono/client";
import type { AppRouter } from "../../../api/src/index.ts";
export const client = hc<AppRouter>("http://localhost:8787/");
// Svelte app - apps/web/...
import { hc } from "hono/client";
import type { AppRouter } from "../../../api/src/index.ts";
export const client = hc<AppRouter>("http://localhost:8787/");
Importing directly from another app like this feels off. What's a better way to share types in a Turborepo setup? Thanks!
14 replies
HHono
Created by Gg on 8/26/2024 in #help
background jobs with Hono + Bun
Hi all, I'm planning on building a backend with Hono and I'm looking for a solution to do background jobs (backed by a queue). Are there any recommendations in the bun ecosystem for doing this? So far, I've mostly seen BullMQ in the node ecosystem, but bun is not officially supported as far as I know. Is there an alternative for bun?
5 replies