Follow the instructions below to import a single API from WSO2 API Manager and create a Microgateway distribution for it.
Step 1 - Follow the installation prerequisites
Make sure to carry out all the installation prerequisites.
Step 2 - Create a Microgateway project
Let's initialize a API Microgateway project named marketing_project. Navigate to a preferred folder where you want to create the Microgateway project. Thereafter, run the following command.
Step 3 - Build the Microgateway project
Import the API, which is published in WSO2 API Manager.
WSO2 API Microgateway Toolkit prompts for the following.
Username and Password - Enter your user credentials. The username and password should correspond to a valid user in WSO2 API Manager
APIM base URL - This is the WSO2 API Manager URL. If you want to use the default value, click enter.
Trust store location and password of WSO2 API Microgateway Toolkit - If you want to use the default value, click enter.
After the API is imported, you can find the auto-generated Swagger definition in the
<MGW-project>/gen/<Swagger-file-name>.JSONdirectory of the project (e.g.,
Build the WSO2 API Microgateway project (e.g.,marketing_project).
Navigate to the
<MGW_HOME>/bindirectory and run the following command.
This creates an executable file (
/marketing_project/target/marketing_project.balx) that you can use to expose the API via WSO2 API Microgateway.
Step 4 - Run the Microgateway
Start WSO2 API Microgateway as follows:
WSO2 API Microgateway starts for the API.