Configuring endpoints on API

Hi, im a student and im testing api gateways so i can later choose one to use in my project.

Currently im testing tyk and im having trouble understanding how to correctly set endpoints in the APIs that i created for testing.

So my problem is that i have for example 2 endpoints in 1 API ( “/vehicle” and “/garage”) and i want to send requests to those endpoints under 1 API (for example Service1)

Is it possible to configure this in a way that i only need to specify the urls like this? :
GET http://localhost:port/vehicle/…
GET http://localhost:port/garage/…

So that /vehicle and /garage are linked to Service1 and tyk routes to Service1 when the requests have those endpoints.

Im sorry if this is a basic issue and i probably missed some documentation explaining it, but i´ve been searching for a while and im not being able to find a solution or understand if its possible.

The solution i encountered so far where to create 2 apis the with same target url and listen_paths /vehicle and /garage.

Thank you for the attention

Hi @tiago_ferreira and welcome to Tyk :slight_smile:

If you think of Tyk as a proxy for your use case then essentially what we are doing is telling the gateway to send traffic to a specific endpoint.
one way to achieve this is as you have stated with essentially 2 api proxies being set up to forward to the same endpoint i.e.
http://localhost:port/vehicle >>> http://endpoint/vehicle
http://localhost:port/garage >>> http://endpoint/garage

if you only wanted to expose a single service you would set the gateway up to proxy:
http://localhost:port/service >>> http://endpoint
you would then call the service and add /vehicle or /garage to hit the correct part of your service.

Normally you would create documentation for your published api (using OAS or swagger or similar) which would describe these endpoints and how to use them toyour users.

Hope that helps? let us know if you need any more help.
Thanks, Gregor