• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
vawogbemi

vawogbemi

HonoDenoVite

Remix of vawogbemi/denoVite
Public
Like
HonoDenoVite
Home
Code
6
src
3
README.md
deno.json
deno.lock
H
server.tsx
vite.config.ts
Branches
1
Pull requests
Remixes
1
History
Environment variables
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
/
README.md
Code
/
README.md
Search
5/14/2025
Viewing readonly version of main branch: v52
View latest version
README.md

Hono + Deno + Val Town

A simple project demonstrating how to use Hono with Deno in Val Town. This project provides server-side rendering with Hono and client-side interactivity with vanilla JavaScript.

Architecture

This project uses:

  • Deno: As the runtime environment
  • Hono: For server-side routing and API endpoints
  • ESM.sh: For importing dependencies

How it works

The application has two main components:

  1. Server-side (Hono): Handles API requests and server-side rendering

    • Defined in src/index.tsx
    • Exports a Hono app that handles routes and API endpoints
  2. Client-side (JavaScript): Provides interactive UI components

    • Embedded directly in the HTML
    • Uses Hono's client to communicate with the API

Server implementation

The server uses Hono to handle all requests:

Create val
// API routes app.get("/api/clock", (c) => { return c.json({ time: new Date().toLocaleTimeString(), }); }); // Main page route app.get("/", (c) => { return c.html(` <!DOCTYPE html> <html lang="en"> <!-- HTML content with embedded JavaScript --> </html> `); });

Key Features

  1. Direct ESM imports: Using esm.sh for all dependencies
  2. Embedded client code: JavaScript is embedded directly in the HTML
  3. Simple API: Demonstrates basic API functionality with Hono
  4. No build step: Everything runs directly without a build process

Troubleshooting

If you encounter issues:

  1. Check the server logs: Look for error messages in the console
  2. Verify import paths: Make sure all imports use esm.sh URLs
  3. Browser console: Check for client-side errors in the browser console

Development

To make changes:

  1. Edit the Hono routes in src/index.tsx
  2. Update client-side code in the embedded script
  3. The server will handle the changes on the next request
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.