/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-building-a-larger-a-188d7425e8fb-building-a-larger-application-s0078-c0000.md
Building a larger application (1) - hono-docs
Building a larger application (1) Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt building a larg...
Building a larger application (1)
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#building-a-larger-application
Summary
Use app.route() to build a larger application without creating "Ruby on Rails-like Controllers". If your application has /authors and /books endpoints and you wish to separate files from index.ts, create authors.ts and `books.t...
Content
Use app.route() to build a larger application without creating "Ruby on Rails-like Controllers".
If your application has /authors and /books endpoints and you wish to separate files from index.ts, create authors.ts and books.ts.
// authors.ts
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.json('list authors'))
app.post('/', (c) => c.json('create an author', 201))
app.get('/:id', (c) => c.json(`get ${c.req.param('id')}`))
export default app// books.ts
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.json('list books'))
app.post('/', (c) => c.json('create a book', 201))
app.get('/:id', (c) => c.json(`get ${c.req.param('id')}`))
export default appThen, import them and mount on the paths /authors and /books with app.route().