Multiple routes on a worker?
Hey, I'm new to cloudflare stuff and I was just trying to figure out how to set up a worker with multiple routes, for example can I have one action activated when
http://example.com/something
is called and have a different action when http://example.com/somethingelse
is called?1 Reply
Hi,
You could assign both routes to the worker under the triggers section of the worker's settings, and then set the worker to do something like the following:
You could use the following code to do the same across different domains, or if you prefer to work with the full URLs: