• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
ianmenethil

ianmenethil

ZenServer

Unlisted
Like
ZenServer
Home
Code
12
.cursor
docs
9
src
10
tasks
tests
.gitignore
.vtignore
README.md
deno.json
H
main.ts
openapi.json
x.html
Branches
1
Pull requests
Remixes
History
Environment variables
22
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
docs
/
hono-deno-getting-started.md
Code
/
docs
/
hono-deno-getting-started.md
Search
7/7/2025
Viewing readonly version of main branch: v237
View latest version
hono-deno-getting-started.md

Hono with Deno: Getting Started

Source: https://hono.dev/docs/getting-started/deno


1. Install Deno

Follow the official Deno installation guide.


2. Project Setup

Start a new project with:

deno init --npm hono my-app cd my-app

Select the deno template if prompted.


3. Hello World Example

Create val
import { Hono } from 'hono' const app = new Hono() app.get('/', (c) => c.text('Hello Deno!')) Deno.serve(app.fetch)

4. Run the App

deno task start

5. Change Port Number

Specify a port in main.ts:

Create val
Deno.serve({ port: 8787 }, app.fetch)

6. Serving Static Files

Use serveStatic from hono/deno:

Create val
import { Hono } from 'hono' import { serveStatic } from 'hono/deno' const app = new Hono() app.use('/static/*', serveStatic({ root: './' })) app.use('/favicon.ico', serveStatic({ path: './favicon.ico' })) app.get('/', (c) => c.text('You can access: /static/hello.txt')) app.get('*', serveStatic({ path: './static/fallback.txt' })) Deno.serve(app.fetch)

You can customize static file serving with options like rewriteRequestPath, mimes, onFound, onNotFound, and precompressed.


7. Testing

Write tests using Deno's built-in test runner:

Create val
import { Hono } from 'hono' import { assertEquals } from '@std/assert' Deno.test('Hello World', async () => { const app = new Hono() app.get('/', (c) => c.text('Please test me')) const res = await app.request('http://localhost/') assertEquals(res.status, 200) })

Run with:

deno test hello.ts

8. Import Specifiers

You can use either jsr:@hono/hono or npm:hono in your deno.json imports:

{ "imports": { "hono": "jsr:@hono/hono" } }

Or for npm:

{ "imports": { "hono": "npm:hono", "zod": "npm:zod", "@hono/zod-validator": "npm:@hono/zod-validator" } }

For more details and advanced options, see the full documentation at https://hono.dev/docs/getting-started/deno.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.