Open dipakparmar opened 1 month ago
Hi @dipakparmar
This is a super exciting proposal, though I don't know if we should do it in our official repo like honojs/middleware
or hono/node-server
. I think it is more prefer discussing it in the honojs/hono
repo. So I'll transfer it.
A quick response.
I think we can also follow the Connect
specs: https://github.com/senchalabs/connect
A quick response.
I think we can also follow the
Connect
specs: senchalabs/connect
Thanks @yusukebe, https://github.com/senchalabs/connect looks interesting, I'll check it out.
I'm exploring the possibility of supporting Express.js compatible middleware in Hono. This would allow for easier migration from Express to Hono and enable the use of the vast ecosystem of Express middleware within Hono applications.
Proposed Implementation
I'm looking for something like this for backward compatibility:
Current Issues
So far, I haven't been able to make this work due to type incompatibility issues. The main challenges are:
Context
object doesn't directly map to Express'sreq
andres
objects.IncomingMessage
andServerResponse
types from Node.js http module don't align perfectly with Hono's request and response handling.Questions
Goals
Any insights, suggestions, or assistance on how to achieve this would be greatly appreciated. Thank you!