How to intercept pages.dev requests using Cloudflare Workers?
HI 👋 ! Is it possible to intercept requests to
*.project-name.pages.dev
routes using Cloudflare Workers??5 Replies
Like with #functions?
Yes
But with functions, only requests to one specific route can be handled. I want to intercept all requests.
You could use
/[[catchall]].(js/ts)
?But @HardAtWork does it intercept requests for the paths that already exist?? For example, if there's a path,
/blog
, will the function intercept this request??I believe they run in the order they are added? As in, if you add a catch all first, only the catch all will run