Nav

Deploying the Project

In Studio, you prepare the API for auto-discovery. You need to set multiple auto-discovery global elements, one for each flow to which you want to direct requests. In the auto-discovery global configuration, you select a drop-down containing the names of a flow in the project.

Finally, you run the project as a Mule application. Studio deploys the flows as individual APIs to Anypoint Platform, and registers the APIs with API Manager. After registering the APIs, you can apply policies.

To deploy an APIkit project to Anypoint Platform:

  1. In Studio, select Anypoint Studio > Preferences > Anypoint Studio > Anypoint Platform for APIs, and enter your client ID and client secret.

  2. In the Global Elements dialog, configure auto-discovery by entering settings for a global element as follows:

    • API Name: vending

    • API Version: 1.0development

    • Flow Name: api-main

  3. Enter auto-discovery settings for a second global element as follows:

    • API Name: test-policy

    • API Version: 1.0development

    • Flow Name: apiFlow

  4. In Project Explorer, right-click the APIkit project name, and select Run As > Mule Application.

    Studio connects to API Manager in API Platform. The Studio console indicates that the project is deployed:

    INFO  2016-08-20 12:54:28,564 [main] com.mulesoft.module.client.autodiscovery.AutoDiscoveryDeploymentListener: Successfully created API named vending with version 1.0development
    INFO  2016-08-20 12:54:28,774 [main] com.mulesoft.module.client.autodiscovery.
    ...
    AutoDiscoveryDeploymentListener: Successfully registered source http://192.168.1.127:8081/remote-vending/test-policy to API test-policy with version 1.0development
    ...
  5. Sign into Anypoint Platform, or if you are already signed in, refresh the browser.

  6. Go to API Manager.

    The vending and test-policy APIs appear in API Manager.

Using the implementation URI, you can now simulate calls to the API using API Console. For example:

http://192.168.127:8081/console

You can also apply policies to the APIs.