File tree Expand file tree Collapse file tree 4 files changed +25
-10
lines changed
Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 1616 "check" : " biome check"
1717 },
1818 "dependencies" : {
19- "@hono/node-server" : " ^1.9.0" ,
2019 "@hono/node-server" : " ^1.19.4" ,
2120 "@tailwindcss/vite" : " ^4.1.13" ,
2221 "@tanstack/react-devtools" : " ^0.7.0" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { cors } from "hono/cors";
1111import { logger } from "hono/logger" ;
1212import { createRouter } from "./router.tsx" ;
1313import { handler as testHandler } from "./routes/-test.ts" ;
14+ import { setupApiRoutes } from "./routes/-api.ts" ;
1415import "dotenv/config" ;
1516
1617const port = process . env . NODE_SERVER_PORT
@@ -24,15 +25,8 @@ app.use(logger());
2425
2526app . use ( cors ( ) ) ;
2627
27- // Health check endpoint
28- app . get ( "/api/health" , ( c ) => {
29- return c . json ( {
30- status : "ok" ,
31- timestamp : new Date ( ) . toISOString ( ) ,
32- uptime : process . uptime ( ) ,
33- environment : process . env . NODE_ENV || "development" ,
34- } ) ;
35- } ) ;
28+ // Setup API routes
29+ setupApiRoutes ( app ) ;
3630
3731app . get ( "/test" , testHandler ) ;
3832
Original file line number Diff line number Diff line change 1+ import type { Hono } from "hono" ;
2+
3+ export const setupApiRoutes = ( app : Hono ) => {
4+ // Health check endpoint
5+ app . get ( "/api/health" , ( c ) => {
6+ return c . json ( {
7+ status : "ok" ,
8+ timestamp : new Date ( ) . toISOString ( ) ,
9+ uptime : process . uptime ( ) ,
10+ environment : process . env . NODE_ENV || "development" ,
11+ } ) ;
12+ } ) ;
13+
14+ // Add more API routes here as needed
15+ } ;
Original file line number Diff line number Diff line change 1+ import { describe , expect , it } from 'vitest'
2+
3+ describe ( 'Root Route' , ( ) => {
4+ it ( 'should pass placeholder test' , ( ) => {
5+ expect ( true ) . toBe ( true )
6+ } )
7+ } )
You can’t perform that action at this time.
0 commit comments