AlonGvili / remix-worker-template

πŸ“œ Starter template for setting up a Remix app on Cloudflare Workers

Home Page:https://template.remix-run.workers.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

remix-worker-template

Deploy to Cloudflare Workers

The current starter template is based on Remix 0.21.0

Differences with the Remix CF Workers template

While the official template provides the bare minimums for you to kickstart a Remix app running on Cloudflare Workers, this starter template adds a few extra tools that are common for development and let you be productive right away. These tools include:

  • Tailwind
  • ESLint
  • Prettier
  • Cypress

Node Version

Please make sure the node version is >= 16.7. If you are using nvm, just run:

nvm use

This allows miniflare to serve a development environment as close to the actual worker runtime as possibile.

Development

To starts your app in development mode, rebuilding assets on file changes, the recommended approach is:

npm run dev

This will run your remix app in dev mode using miniflare with the Cypress test runner opened.

Deployment

First, preview your app with:

npx wrangler preview

When confirmed everythings works, deploy the worker with Wrangler using:

npx wrangler publish

CI/CD

The template ships a basic deploy workflow which is triggered when new changes are pushed to the main branch.

To setup the CI environment, following variables are required:

  • CF_API_TOKEN
  • CF_ACCOUNT_ID

These values could be found / created on your Cloudflare Dashboard. If your project is bootstrapped with the deploy button above, both should be already set in the repository.

Alternatively, CF_ACCOUNT_ID can be set as account_id on the wrangler.toml.

About

πŸ“œ Starter template for setting up a Remix app on Cloudflare Workers

https://template.remix-run.workers.dev

License:MIT License


Languages

Language:TypeScript 84.8%Language:JavaScript 14.5%Language:Shell 0.7%