Node.js 
Node.js is an open-source, cross-platform JavaScript runtime environment.
Hono is not designed for Node.js at first. But with a Node.js Adapter it can run on Node.js as well.
INFO
It works on Node.js versions greater than 18.x. The specific required Node.js versions are as follows:
- 18.x => 18.14.1+
- 19.x => 19.7.0+
- 20.x => 20.0.0+
Essentially, you can simply use the latest version of each major release.
1. Setup 
A starter for Node.js is available. Start your project with "create-hono" command.
npm create hono@latest my-appnpm create hono@latest my-appyarn create hono my-appyarn create hono my-apppnpm create hono my-apppnpm create hono my-appbunx create-hono my-appbunx create-hono my-appdeno run -A npm:create-hono my-appdeno run -A npm:create-hono my-appMove to my-app and install the dependencies.
cd my-app
npm icd my-app
npm icd my-app
yarncd my-app
yarncd my-app
pnpm icd my-app
pnpm icd my-app
bun icd my-app
bun i2. Hello World 
Edit src/index.ts:
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Node.js!'))
serve(app)import { serve } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Node.js!'))
serve(app)3. Run 
Run the development server locally. Then, access http://localhost:3000 in your Web browser.
npm run devnpm run devyarn devyarn devpnpm devpnpm devChange port number 
You can specify the port number with the port option.
serve({
  fetch: app.fetch,
  port: 8787,
})serve({
  fetch: app.fetch,
  port: 8787,
})Serve static files 
You can use serveStatic to serve static files from the local file system.
import { serveStatic } from '@hono/node-server/serve-static'
app.use('/static/*', serveStatic({ root: './' }))import { serveStatic } from '@hono/node-server/serve-static'
app.use('/static/*', serveStatic({ root: './' }))rewriteRequestPath 
If you want to map http://localhost:3000/static/* to ./statics, you can use the rewriteRequestPath option:
app.get(
  '/static/*',
  serveStatic({
    root: './',
    rewriteRequestPath: (path) => path.replace(/^\/static/, '/statics'),
  })
)app.get(
  '/static/*',
  serveStatic({
    root: './',
    rewriteRequestPath: (path) => path.replace(/^\/static/, '/statics'),
  })
)http2 
You can run hono on a Node.js http2 Server.
unencrypted http2 
import { createServer } from 'node:http2'
const server = serve({
  fetch: app.fetch
  createServer,
})import { createServer } from 'node:http2'
const server = serve({
  fetch: app.fetch
  createServer,
})encrypted http2 
import { createSecureServer } from 'node:http2'
import { readFileSync } from 'node:fs'
const server = serve({
  fetch: app.fetch,
  createServer: createSecureServer,
  serverOptions: {
    key: readFileSync('localhost-privkey.pem'),
    cert: readFileSync('localhost-cert.pem'),
  },
})import { createSecureServer } from 'node:http2'
import { readFileSync } from 'node:fs'
const server = serve({
  fetch: app.fetch,
  createServer: createSecureServer,
  serverOptions: {
    key: readFileSync('localhost-privkey.pem'),
    cert: readFileSync('localhost-cert.pem'),
  },
}) Hono
Hono