Local Test Workflow

How we work: test on staging first, promote to main for live. Staging workflow

Your flow

StepWhat happens
1. Apply changesCode edits on branch staging
2. Staging siteCloudflare Pages auto-updates (free preview URL)
3. Go liveMerge stagingmainmonexmonad.xyz updates
4. Cloudflare APIDoes NOT auto-deploy — run manually when ready
5. Test locallyDownload ZIP → run local server → play on your PC

Download ZIP (easiest)

After changes are on main:

https://github.com/jericddd/MonEx/archive/refs/heads/main.zip

Or: GitHub repo → CodeDownload ZIP

Or: GitHub → ActionsPackage test ZIPRun workflow → download artifact (no node_modules).

Run locally (Windows)

cd path\to\MonEx-main\x-bot
npm install
npm run server

Open in browser:

http://localhost:3001/home.html
http://localhost:3001/monanimal_game.html

Local server uses the same API routes as Cloudflare. For cloud API instead, set js/monex-config.js to your Worker URL.

Deploy Cloudflare (only when you want)

When you are ready to push API changes live:

  1. GitHub → Actions
  2. Deploy Cloudflare API
  3. Run workflow → branch main

Or on your PC:

cd cloudflare\monex-api
npx wrangler deploy

What auto-updates vs manual

TargetOn push to stagingOn merge to main
Cloudflare Pages (staging preview)✅ Auto (via Cloudflare Git link)
GitHub Pages (monexmonad.xyz)✅ Auto
Cloudflare Worker (API)❌ Manual❌ Manual

← Back to Home · Staging workflow · Cloudflare setup