Public
Like
mockingbird
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.
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:
- Create a new Val Town project
- Upload your files
- The app will automatically detect the Val Town environment
- Environment-aware file reading: Automatically uses Val Town's
readFileor Deno's native file reading - Hono for backend: Fast, lightweight web framework
- Alpine.js for frontend: Minimal, reactive frontend framework
- Tailwind CSS: Utility-first styling
- Menlo font: Monospace typography throughout
GET /- Serves the main HTML pageGET /api/health- Health check endpoint
The 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.
