Adding APIs and global middleware with Universal Middleware (or not) #3116
|
i know that there's been some back + forth on how apis should be integrated, but that it is possible to add middleware/handlers to /server/entry. the comments in the starter template say:
thanks to feedback from @magne4000, i now understand that: if so, then it seems like there wouldn't be any major downsides to something like this if i wanted to run some middleware or add an api layer: function startApp() {
const app = new Hono()
.use(/** */)
.get(/** */)
apply(app)
}
|
Replies: 2 comments 6 replies
|
i'll add more specific questions that i have as they come up here. numbering for clarity only:
|
|
You should be able to use Hono however you please :)
There is no hidden cost.
No, any request method is supported, you can add HEAD or OPTIONS handlers if you want to. Just think about it like Hono is using Vike, not the other way around. |
You should be able to use Hono however you please :)
There is no hidden cost.
No, any request method is supported, you can add HEAD or OPTIONS handlers if you want to. Just think about it like Hono is using Vike, not the other way around.