vask3/hub ? reverse-engineered prompt

Reverse engineered prompt

Build me a Cloudflare Worker in TypeScript that acts as the router for my vasko.blog services. It should handle requests for hub.vasko.blog and forward them to the right upstream based on either the path or the subdomain, so hub.vasko.blog/webinar/room/42 and webinar.hub.vasko.blog/room/42 both go to the webinar service. Keep the request method, body, query string, and headers intact, add the usual forwarded headers plus a router service header, and make sure WebSockets pass through too since some services need them.

Also add a simple homepage for the router host, a health check endpoint, and an endpoint that shows the current route table. A few service names should never be routed through this worker and should return 404 instead. Make it easy to change the host and routes from the config, and include the local dev and deploy setup so I can run it with Wrangler and ship it cleanly.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab