type Bindings = {
event: LambdaEvent;
lambdaContext: LambdaContext;
};
const apiApp = new Hono<{ Bindings: Bindings }>();
apiApp.on(
'GET',
'/hello/:world/:test',
async (c) => {
console.log("Route invoked.");
console.log("routePath", c.req.routePath) // prints /hello/:world/:test
const id = c.req.param('world')
console.log(id) // prints the correct path parameter
console.log(c.env.event) // does not contain event.pathParameters object that would normally be populated with the path params
const resp = await lambdaHandlerFunc(c.env.event, c.env.lambdaContext);
return c.json(JSON.parse(resp.body), resp.statusCode);
},
);
type Bindings = {
event: LambdaEvent;
lambdaContext: LambdaContext;
};
const apiApp = new Hono<{ Bindings: Bindings }>();
apiApp.on(
'GET',
'/hello/:world/:test',
async (c) => {
console.log("Route invoked.");
console.log("routePath", c.req.routePath) // prints /hello/:world/:test
const id = c.req.param('world')
console.log(id) // prints the correct path parameter
console.log(c.env.event) // does not contain event.pathParameters object that would normally be populated with the path params
const resp = await lambdaHandlerFunc(c.env.event, c.env.lambdaContext);
return c.json(JSON.parse(resp.body), resp.statusCode);
},
);