Skip to content

Files

Latest commit

95c3e61 · Feb 15, 2024

History

History
This branch is up to date with kriasoft/react-starter-kit:main.

edge

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 3, 2023
Feb 15, 2024
Feb 25, 2023
Feb 25, 2023
Feb 25, 2023
Feb 15, 2024
Mar 17, 2023
Jun 7, 2023
Mar 17, 2023

CDN edge endpoint

CDN edge endpoint powered by Cloudflare Workers that serves the front-end app.

Directory Structure

├──core — Core application modules
├──routes — API routes (endpoints)
├──global.d.ts — Global TypeScript declarations
├──index.ts — Cloudflare Worker entry point
├──package.json — The list of dependencies
├──tsconfig.ts — TypeScript configuration (docs)
├──vite.config.ts — JavaScript bundler configuration (docs)
└──wrangler.toml — Wrangler CLI configuration (docs)

Getting Started

Test the app locally using Vitest:

$ yarn workspace edge test

Build and deploy the app by running:

$ yarn workspace app build
$ yarn workspace edge build
$ yarn workspace edge deploy [--env #0]

Start a session to livestream logs from a deployed Worker:

$ yarn workspace edge wrangler tail [--env #0]

Where --env is one of the supported environments, such as --env=prod, --env=test (default).

Scripts

  • build — Build the app for production
  • test — Run unit tests
  • coverage — Run unit tests with enabled coverage report
  • deploy [--env #0] — Deploy the app to Cloudflare (CDN)
  • wrangler [--env #0] — Wrangler CLI (wrapper)

References