Skip to content

Commit

Permalink
aws special casing and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
skorfmann committed Feb 29, 2024
1 parent 423dc08 commit f2645f1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/typescript-hono/hono.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ type Bindings = {
BUCKET: cloud.IBucketClient
}

export const app = new Hono<{ Bindings: Bindings }>();
const env = process.env.WING_TARGET; // Handle the /prod prefix from the API Gateway for tf-aws
const basePath = env === 'tf-aws' ? '/prod/' : '';

export const app = new Hono<{ Bindings: Bindings }>().basePath(basePath);

app.use(async (c, next) => {
console.log(`[${c.req.method}] ${c.req.url} ${c.req.path} ${c.req.routePath} ${c.req.matchedRoutes}`)
await next()
})

const Layout: FC = (props) => {
return (
Expand Down

0 comments on commit f2645f1

Please sign in to comment.