Develop the American Flights App
Use Anypoint Code Builder to create and implement an API specification that returns flight information from a MySQL database:
-
Designing the American Flights API Spec:
-
Start the American Flights API specification.
-
Add a resource and methods.
-
Add query parameters and nested resources.
-
Add fragments and examples:
-
Add API fragments from Exchange for a data type and examples to the American Flights API specification.
-
Create your own examples for the specification.
-
Add a custom message for a response.
-
-
-
Adding Examples to the API Spec
Use the Mocking Service in the API Console to check the request and responses that you configured for American Flights API.
-
Publishing the API Spec to Anypoint Exchange:
Publish the American Flights API specification to Exchange so that other team members can find and implement it.
-
Create an integration application for the American Flights example:
-
Integrating American Flights Processes:
Start by creating a basic integration for the American Flights example. This integration provides some of the logic for processing requests from the American Flights API.
-
Connecting to a Database from the App:
-
Import the Anypoint Connector for Database (Database Connector) from Exchange.
-
Configure a database operation to connect to an external database from your Mule flow.
-
-
Transforming Flight Data with DataWeave:
Use DataWeave to transform and match flight data to your API specification.
-
-
Implementing the American Flights API Spec:
-
Import your American Flights API specification from Anypoint Exchange.
-
Scaffold the specification into the American Flights project that you are developing.
-
Add logic to implement an endpoint in the API.
-
-
Debugging the American Flights App:
-
Prepare to debug your Mule application by adding Logger and Set Variable components to better understand the behavior of your flows.
-
Set up breakpoints to stop your Mule application at specific points during a debug session.
-
Run a debug session, and inspect the message and variables at different points during your application’s execution.
-
-
Deploying the American Flights App:
-
Deploy your American Flights application to CloudHub.
-
Enable your team to send requests to your API and return flight information from a database.
-