import { useModdable } from 'moddable'
import { core } from 'moddable/core/api'
import { stripe } from 'moddable/modules/stripe/api'
export default {
async fetch(request, env, context) {
const moddable = useModdable('api', [core, stripe], { env })
return moddable.helpers.useServer(moddable).fetch(request, env, context)
}
}
makeSignal('api', '/ping', {
middleware: [],
handler: async (moddable) => {
const { responses } = moddable.helpers
return responses.json({ ok: true })
}
})
makeView({
name: 'PricingView',
tag: 'pricing-view',
pathname: '/pricing',
template,
style,
logic,
layouts: ['site-layout']
})
$ moddable dev --watch
→ Worker, KV, R2, queues, Durable Objects
$ moddable deploy
→ live on Cloudflare's network
Pages render in the region the visitor is in, with cache-first delivery behind them. Web vitals and crawlability come out of where the code runs, not out of a checklist.
Serverless infrastructure absorbs a spike on demand. There are no instances to size, no clusters to keep warm and nothing to page you at 3am about capacity.
You run your own platform on metered infrastructure instead of renting per-seat, per-feature services around it — and the data stays in your account.