| 1 | import { Hono } from "hono"; |
| 2 | import { cors } from "hono/cors"; |
| 3 | import type { ApiResponse } from "shared"; |
| 4 | |
| 5 | const app = new Hono(); |
| 6 | |
| 7 | app.use(cors()); |
| 8 | |
| 9 | app.get("/", (c) => { |
| 10 | return c.text("Hello Hono!"); |
| 11 | }); |
| 12 | |
| 13 | app.get("/hello", async (c) => { |
| 14 | const data: ApiResponse = { |
| 15 | message: "Hello BHVR!", |
| 16 | success: true, |
| 17 | }; |
| 18 | |
| 19 | return c.json(data, { status: 200 }); |
| 20 | }); |
| 21 | |
| 22 | export default app; |