index.ts
1 import { Hono } from 'hono' 2 import { cors } from 'hono/cors' 3 import type { ApiResponse } from 'shared/dist' 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 15 const data: ApiResponse = { 16 message: "Hello BHVR!", 17 success: true 18 } 19 20 return c.json(data, { status: 200 }) 21 }) 22 23 export default app