Thứ Năm, 2 tháng 6, 2016

Deploy Your API to a Mule Runtime

Deploy Your API to a Mule Runtime

This step in the walkthrough assumes that you have completed building an APIkit project in the Build step. Your APIkit project should be saved as a deployable zip file. If you didn’t create your own APIkit project but you want to jump in here, you can download and use this project.
Download the .zip file, go to Studio, click on "File", then "Import", select "Anypoint Studio generated Deployable Archive (zip)" and import your download zip file.
This walkthrough also assumes **you have deployed your API to a Mule runtime. To deploy to a Mule on-premises runtime, see the instructions to download and install the runtime before proceeding. To deploy to CloudHub, sign up for an Anypoint Platform account and you have at least one available worker in your trial or subscription.

Deploying

Deploy your APIkit project to a Mule runtime of your choice.
For the purposes of this walkthrough, you can deploy the API to a runtime running on your localhost machine and continue testing. However, in order to make your API accessible to other Anypoint Platform users or to the API Console (which accesses your API through a Web proxy), your API must be implemented on a server location that is accessible via the Web. For this reason, we recommend that you deploy to a runtime on CloudHub or to a server with an IP address that can be accessed from the Web. CloudHub deployment might not be available to you depending onentitlements you purchased.
  1. If you have not downloaded the Mule standalone runtime, click here and follow the steps to install the latest version.
  2. Start Mule in the command line by running:
    Windows: <MULE_HOME>\bin\mule
    Mac and Unix: <MULE_HOME>/bin/mule
    <MULE_HOME> is the value of the MULE_HOME variable employed by Mule, usually the root directory of the installation, such as /opt/Mule/mule-standalone-3.8.0/
  3. Navigate to the directory where the .zip file is located and copy the .zip file. Ensure that your copy of the file does not have any spaces in the name. 
  4. Drop the copy of the .zip file into the <MULE_HOME>/apps folder.
  5. Mule polls this folder for new applications every five seconds. Watch your command line window to track the progress of the deployment.
  6. When you see the message Started app 'TshirtService', then your API is deployed to the Mule runtime.
If you wish to undeploy your application, navigate to the app directory and delete the file your_application.txt. This removes your application from the /app directory, which automatically undeploys it.

Không có nhận xét nào:

Đăng nhận xét