Skip to content
ArticleBeginner

Tutorial - React SPA with an API

Adapt a Vite + React single-page app to the Cloudflare Vite plugin and add an API Worker behind it.

Last updated
Sep 5, 2026
Read the original

This tutorial walks through adapting a Vite project to use the Cloudflare Vite plugin, so your React SPA and its API run together on Cloudflare Workers. Most steps also apply to existing Vite projects and other front-end frameworks.

What you’ll learn

  • Set up and configure a React SPA with the Cloudflare Vite plugin
  • Add an API Worker that the front end calls

Cloudflare products used

Workers, Cloudflare Vite plugin.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

Keep learning