CSS Animations
June 5, 2020The Importance of Team Building
August 16, 2020Setting up a new API
As Seth said in a prior post, after we setup a Gravitee API gateway for a customer, we found that the creation process was a bit hard to follow. To clear that up, I’ll be going through an installation that would hit the Marvel API.
API – General Settings
The main building block of Gravitee is the API. This is where you setup the gateway and entry point for the API you are connecting to. Here you create the name and Context-path of what you want Gravitee to show your users. The context-path is the request URL your users will send to hit your API. By default it will accept GET, POST, and all other query types.
The backend of the API is the next step to setup. This is the URL of the API you want to use to request data from. The URL used here is important to keep the path short. With Gravitee, the path after your API’s context-path will be passed through to the primary API after the backend URL entered. In the example below I entered /public/characters
as the backend path, but if I shortened it to /public
I would be able to use my path and pass-through /characters
like this: /randomHeroLookup/characters
. That will make it easier for the Gravitee API path to call most endpoints for your data API.
Plan Options
Plans in Gravitee are the connection between an API and the users. A plan needs to be setup for any request to be sent to the API. They form what type of requests the user can use to hit the API.
Documentation Setup
In our setup we used a Swagger file to define our API variables. We will talk about Swagger in another post.
Final Deployment
The third building block to Gravitee is the Subscriptions. A subscription is the record between the user and the API they can call. Each subscription is connected to a user and the plan they are using to connect to an API.
In Conclusion
In Gravitee you can setup multiple APIs, Plans, Subscriptions, and have as many Users as you can handle. Gravitee also gives you the ability to separate your API and the public server from being open to your users. This will enhance the security on your data API as well as give you more options to offer to your users.