/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-2-hello-world-a0ae090da402-2-hello-world-s0453-c0000.md
2. Hello World - hono-docs
2. Hello World Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt 2 hello world Summary Edit src/ind...
2. Hello World
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#2-hello-world
Summary
Edit src/index.ts: 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) If you want to gracefully shut down the server, write it...
Content
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)If you want to gracefully shut down the server, write it like this:
const server = serve(app)
// graceful shutdown
process.on('SIGINT', () => {
server.close()
process.exit(0)
})
process.on('SIGTERM', () => {
server.close((err) => {
if (err) {
console.error(err)
process.exit(1)
}
process.exit(0)
})
})