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: v9View latest version
This directory is for backend-specific logic and business logic.
Organize your backend code by feature:
backend/
├── api/ # API-specific logic
├── services/ # Business logic services
└── models/ # Data models
// backend/services/greetings.js
export function getGreeting(name) {
return `Hello, ${name}!`;
}
Import in routes:
// core/routes.js
import { getGreeting } from '../backend/services/greetings.js';
app.get('/api/greet/:name', (c) => {
const name = c.req.param('name');
return c.json({ message: getGreeting(name) });
});