Welcome to the Traffic Router Demo

This Single Page Application demonstrates intelligent traffic routing using Cloudflare Workers.

🌐 SPA Routes

All UI routes are served by Cloudflare Pages

  • /
  • /about
  • /dashboard
  • /any-spa-route

🔗 API Routes

API calls are forwarded to your AWS ALB

  • /api/*
  • /auth/*
  • /webhook/*
  • /admin/api/*

📦 Static Assets

Assets served from Cloudflare Pages CDN

  • /assets/*
  • /css/*
  • /js/*
  • /images/*

🔧 Current Configuration

SPA Domain: demospa.pages.dev
External API: https://your-alb-12345.us-east-1.elb.amazonaws.com
Allowed Origins: https://yourdomain.com, https://www.yourdomain.com

About This Architecture

This setup demonstrates a hybrid cloud architecture combining the best of both worlds:

🌍

User Request

Request comes from anywhere in the world

Cloudflare Workers

Intelligent routing at the edge

↙ ↘
📱

Cloudflare Pages

SPA & Static Assets

🏗️

AWS ALB

API & Backend Services

🎯 Benefits

  • Performance: Static assets cached globally at 275+ locations
  • Security: DDoS protection, WAF, and security headers
  • Cost-effective: Reduced origin server load
  • Scalability: Automatic scaling at the edge
  • Flexibility: Keep existing backend infrastructure

API Testing Interface

Test the traffic routing to your external API endpoints:

🔍 API Endpoint Tests

📊 Custom API Test

🌐 Network Information

📊 Dashboard

Monitor your traffic routing performance:

🚀 Performance Metrics

Page Load Time: Calculating...
Connection Type: Unknown
User Agent: Loading...

🌍 Geographic Info

Language: Unknown
Timezone: Unknown
Platform: Unknown

📡 Request Headers