Skip to content

Basic template to use React Router with Hono on Cloudflare Workers

Notifications You must be signed in to change notification settings

abdrhmniqbal/react-router-hono-on-cloudflare

Repository files navigation

React Router Hono on Cloudflare

Basic template to run React Router with Hono on Cloudflare Workers. Implementation of React Router Hono Server.

Features

  • Typesafe environment variables.
  • Serving static files on development mode.
  • Flat routes implementation.
  • Custom load context bindings examples.
  • Content Security Policy examples.
  • API route on Hono example.

Getting Started

You can quickly create a new React Router application from this templates using the create-react-router CLI.

npx create-react-router@latest --template abdrhmniqbal/react-router-hono-on-cloudflare

Installation

Install the dependencies:

npm install

Development

Start the development server with HMR:

npm run dev

Your application will be available at http://localhost:5173.

Building for Production

Create a production build:

npm run build

Deployment

Deployment is done using the Wrangler CLI.

To deploy directly to production:

npx wrangler deploy

To deploy a preview URL:

npx wrangler versions upload

You can then promote a version to production after verification or roll it out progressively.

npx wrangler versions deploy

Styling

This template comes with Tailwind CSS already configured for a simple default starting experience. You can use whatever CSS framework you prefer.


Authors

Iqbal Abdurrahman https://github.com/abdrhmniqbal

Built with ❤️ using React Router and Hono.