Skip to content

mastrojs/template-basic-cloudflare

Repository files navigation

Mastro Template Basic for Cloudflare Workers

This is a basic TypeScript template for Mastro when using Cloudflare Workers.

Click the green Use this template button in the top right to create your own copy of this repository. Then clone the Code to your computer.

Run locally

If you have multiple projects on your computer that require different Node.js versions, you should install a tool to manage those version for you; for example Volta (see pnpm Support).

Mastro requires Node.js >=24.

JSR recommends to use pnpm.

The first time, you need to:

pnpm install

After that, to start the server:

pnpm run start

and open http://localhost:8787 in your browser.

Next steps

To see how Mastro works, follow the guide.

Note that currently, Mastro on Cloudflare only works with the programmatic router, not the file-based router which is the default when using Mastro with Deno, Bun or plain Node.js.

To make sure you're on the latest Mastro version:

pnpm update @mastrojs/mastro --latest

Deploy to production

pnpm run deploy

About

Basic template for a Mastro project using Cloudflare Workers

Topics

Resources

Stars

Watchers

Forks