A minimal Hono + Alpine.js starter template that works with both Val Town and local Deno.
/
├── main.js # Entry point - minimal Hono setup
├── core/
│ ├── utils.js # Core utilities (file reading, ID generation)
│ └── routes.js # Route definitions
├── frontend/
│ └── index.html # Alpine.js frontend
└── backend/ # Additional backend modules (as needed)
# Run the development server deno task serve # The app will be available at http://localhost:9990
The app is designed to work seamlessly on Val Town. Simply:
readFile or Deno's native file readingGET / - Serves the main HTML pageGET /api/health - Health check endpointThe app detects whether it's running on Val Town or locally:
export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
Add new routes in core/routes.js:
app.get('/api/myendpoint', (c) => {
return c.json({ data: 'your data' });
});
Add reusable functions in core/utils.js or create new modules in /core.
Create new modules in /backend for complex backend logic.