Files
main.tsmain
What you'll learn
- Build a client to another service from its exported type, with a fetch that is a binding, the network, or the other app's request()
- Call a service from inside a handler and let its types flow into the gateway's own response
- Narrow on the service's status and answer with the same status to pass a refusal through
Press Run tests to start the app. Its log appears here.Graded endpoints
The gateway asked the service for every cat and summarised: three cats, two not adopted, Luna the oldest
Forwarded to the service, which answered 200 with the cat; the gateway answers its own message
The service refused with 409; the gateway passes the status and the message through
The service's 404, passed through the same way
The service's state changed, and the gateway reads it fresh on every request