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.
Viewing readonly version of main branch: v5View latest version
This directory contains the core functionality for the Mockingbird app.
Core utility functions:
readFileContent(filePath)- Environment-aware file reading (Val Town vs local Deno)generateId()- Generate unique IDsnowTs()- Get current timestamp
Route setup for the Hono app:
- Defines all HTTP endpoints
- Handles error unwrapping
- Serves static files and API endpoints
Import utilities and routes in your main.js:
import { setupRoutes } from './core/routes.js';
import { readFileContent, generateId } from './core/utils.js';
Create new modules in this directory for shared functionality:
// core/auth.js
export function checkAuth(token) {
// authentication logic
}
Then import where needed:
import { checkAuth } from './core/auth.js';