https://docs.nestjs.com/techniques/performance#adapter
The goal is to have a simple application adapter as we have for express and fastify. E.g.:
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
await app.listen(3000);
and the ideal equivalent:
const app = await NestFactory.create<NestHonoApplication>(AppModule, new HonoAdapter());
await app.listen(3000);
Officially, NestJS is not working on a Hono integration:
A test-app exists in test-app/nest-app
which can be debugged and ran via:
npm run start:debug
To make it easier to compare behavior with the express adapter, its commented out in the main.ts
but can simply be
swapped in.
For some reason, the response / ctx is not correctly propagated when calling the adapter methods.
Instead, an async function is passed around, e.g. to the reply()
. Seems to be something like the next() handler
function.
getRequestHostname
and co. seem to get the correct HonoContext.