• 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: v31
View latest version
README.md

Vite + Deno + React + Hono + TypeScript + Val Town

A Vite project running on Val Town with Hono for API routes and server-side rendering. The server.tsx serves the project and handles both static assets and API requests.

Architecture

This project uses:

  • Vite: For bundling and development
  • Deno: As the runtime environment
  • React: For UI components
  • Hono: For server-side routing and API endpoints
  • TypeScript: For type safety

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 (React): Provides interactive UI components

    • Defined in src/client.tsx
    • Uses Hono's client to communicate with the API

Server implementation

The server handles requests in two ways:

  1. Static assets: Proxied to the Vite build server
Create val
// For static assets (JS, CSS, etc.) if (url.pathname.startsWith("/static/") || url.pathname.endsWith(".js")) { const path = `/${projectVal.username}/${projectVal.name}@${projectVal.version}${url.pathname}`; const proxyUrl = new URL(path, "https://vite-proxy.ng-demo.valtown.net").toString(); const response = await fetch(proxyUrl); // ...return the response }
  1. API and page routes: Handled by the Hono app
Create val
// For API and page routes return app.fetch(req);

When a request for static assets is received, the proxy downloads the project source and builds it using Deno. Once the build is complete, all resulting files are cached and served quickly for future requests.

Development

To make changes:

  1. Edit the Hono routes in src/index.tsx
  2. Update client-side components in src/client.tsx
  3. The server will rebuild 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.