Workers Routes Replacement

I want to create a workers route to:

a.com/api/sth
b.com/api/sth
c.com/api/sth


if worker does not have response, then fetch origin a.com/api/sth as result.

how to write the fetch codes in the worker script?
Was this page helpful?