Skip to content

Commit

Permalink
fix(example): fix node example
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 16, 2024
1 parent 96ad895 commit cb603ba
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions examples/with-node/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@ app.use(logger());

const func = new HonoAzureMiddleware();

app.all(
...func.http({
route: '/SimpleHttpTrigger',
}),
c => {
// Getting the function context
const context = c.var.context;

context.log('JavaScript HTTP trigger function processed a request.');
context.log(`invocationid is: ${context.invocationId}`);
context.log(`The third log message.`);

return context.json({
hello: 'world',
});
}
);
app.all(...func.get('/SimpleHttpTrigger'), c => {
// Getting the function context
const context = c.var.context;

context.log('JavaScript HTTP trigger function processed a request.');
context.log(`invocationid is: ${context.invocationId}`);
context.log(`The third log message.`);

return context.json({
hello: 'world',
});
});

export default serve(
register({
Expand Down

0 comments on commit cb603ba

Please sign in to comment.