This is another option for when the gateway is used with an API client. When calling
getAPIConfig
, all the endpoints will be wrapped inside an object named after this
option. For example: { url: '...', endpoints: { api: { ... } } }
.
The options for how the gateway will handle the headers from the requests and the responses.
This is really a helper for when the gateway is used with an API client. The idea is
that, by default, the routes are mounted on the controller route, but with this
option, you can specify another sub path. For example: The controller is mounted on
/routes
, and if you set root
to gateway
, all the routes will be on
/routes/gateway
.
This become important (and useful) when you get the API client configuration (with
getAPIConfig
): The url
will be the controller route, but all the endpoints will
be modified and prefixed with the root
, that way, you can have multiple gateways in
the same "base route".
It can also includes placeholders for parameters like /:parameter/
, that will be
replaced with the placeholders
option when getAPIConfig
gets called.
The extra options for the gateway controller. They are "extra" because they are mostly helpers for when used with an API client, or for optional features.