Skip to content

Add Cloudflare Pages deployment support#9

Merged
drzo merged 1 commit intomasterfrom
copilot/deploy-to-cf
Mar 31, 2026
Merged

Add Cloudflare Pages deployment support#9
drzo merged 1 commit intomasterfrom
copilot/deploy-to-cf

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Influent is a Java WAR app with no Cloudflare deployment path. This adds a hybrid deployment model: static frontend assets served via Cloudflare Pages CDN, with API traffic proxied to the Java backend via Pages Functions.

New files

  • wrangler.toml — Pages project config; pages_build_output_dir = "dist", compatibility_date, and BACKEND_URL variable (override in the Pages dashboard)
  • functions/influent/rest/[[path]].js — Pages Function proxying /influent/rest/* to the Java backend; sets X-Forwarded-Host/X-Forwarded-Proto so Aperture's %host% token resolves to the Pages domain rather than the backend host
  • functions/influent/rpc/[[path]].js — same proxy for /influent/rpc/*
  • _headers — security headers (X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy); Cache-Control: immutable for versioned static asset paths; no-cache for index.html
  • build-cloudflare.sh — runs mvn package for any of the four apps (influent-app, bitcoin, kiva, walker) with -Penvironment=deployment -DskipTests, unzips the WAR into dist/, strips WEB-INF/ and META-INF/

.gitignore

Added dist/ to exclude the build artefact.

Deploy

./build-cloudflare.sh influent-app          # builds + extracts WAR → dist/
wrangler pages project create influent      # first time only
wrangler pages deploy dist/ --project-name influent

Set BACKEND_URL (e.g. https://api.example.com) in the Cloudflare Pages dashboard under Settings → Environment variables. The Java backend must be independently hosted and reachable from Cloudflare's network.

@drzo drzo marked this pull request as ready for review March 31, 2026 02:46
@drzo drzo merged commit 4ce414c into master Mar 31, 2026
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants