How can add two endpoints/apis in same cloudflare worker

All the examples(Examples · Cloudflare Workers docs) in the documentation section only show one endpoint so I am wondering if it is possible to do multiple related endpoints in the same workers. If so, how do I do the routing to the two different endpoints. Thanks.

You can either do it manually by examining the request and using if statements, or you can use the example router they provide:

Got it. Thank you