跳到正文
文章入门

用 Vite 插件构建带 API 的 React 单页应用

把 Vite + React 单页应用接入 Cloudflare Vite 插件,并为它添加一个 API Worker。

最近更新
2026年9月5日
阅读原文

该介绍目前仅提供英文版本。

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.

继续学习