mirror of
https://github.com/khairul169/home-lab.git
synced 2025-04-28 08:39:34 +07:00
19 lines
483 B
TypeScript
19 lines
483 B
TypeScript
import { Hono } from "hono";
|
|
import { cors } from "hono/cors";
|
|
import { serveStatic } from "hono/bun";
|
|
import { HTTPException } from "hono/http-exception";
|
|
import routes from "./routes/_routes";
|
|
|
|
const app = new Hono()
|
|
.use(cors())
|
|
.use("*", serveStatic({ root: "./public" }))
|
|
.route("/", routes)
|
|
.onError((err, c) => {
|
|
if (err instanceof HTTPException) {
|
|
return err.getResponse();
|
|
}
|
|
return c.json({ message: err.message }, 500);
|
|
});
|
|
|
|
export default app;
|