Expose an API
Put a backend behind a route, share a backend and its plugins between routes, stand in for a backend while it is built, and forward a plain TCP port. Each guide does one job, in the order the console does it, and ends with a request you send and the answer to expect.
Before the guides, read How G8 handles a request. It follows the way a request takes through the gateway and the objects it meets.
Read in this order
- Route requests to a backend. Create a route that sends requests for one path to two backend nodes, and find the address clients call.
- Share a backend between routes. Keep the backend nodes once as an upstream with a health check, and point routes at it.
- Share plugins between routes. Put the routes of one backend on a service so they share its backend nodes and its plugins.
- Answer with a mock while the backend is built. Put mocking on a route so it answers a made-up order while the real backend is still being written.
- Forward a TCP port. Create a stream route that forwards one port of the gateway to backend nodes, with no HTTP in between.
G8 dev