1
1
import { Hono } from "hono" ;
2
- import { routes } from "./routes/index.ts" ;
2
+ import { companionRoutes , miscRoutes } from "./routes/index.ts" ;
3
3
import { Innertube } from "youtubei.js" ;
4
4
import { poTokenGenerate , type TokenMinter } from "./lib/jobs/potoken.ts" ;
5
5
import { USER_AGENT } from "bgutils" ;
@@ -11,7 +11,6 @@ import { existsSync } from "@std/fs/exists";
11
11
import { parseConfig } from "./lib/helpers/config.ts" ;
12
12
const config = await parseConfig ( ) ;
13
13
import { Metrics } from "./lib/helpers/metrics.ts" ;
14
- import health from "./routes/health.ts" ;
15
14
16
15
const args = parseArgs ( Deno . args ) ;
17
16
@@ -138,9 +137,14 @@ companionApp.use("*", async (c, next) => {
138
137
c . set ( "metrics" , metrics ) ;
139
138
await next ( ) ;
140
139
} ) ;
141
- routes ( companionApp , config ) ;
140
+ companionRoutes ( companionApp , config ) ;
141
+
142
+ app . use ( "*" , async ( c , next ) => {
143
+ c . set ( "metrics" , metrics ) ;
144
+ await next ( ) ;
145
+ } ) ;
146
+ miscRoutes ( app , config ) ;
142
147
143
- app . route ( "/healthz" , health ) ;
144
148
app . route ( "/" , companionApp ) ;
145
149
146
150
// This cannot be changed since companion restricts the
0 commit comments