For more information on API Builder, getting started with Appcelerator tooling, etc. see the following:
- Sign up for an Appcelerator account
- Download the Appcelerator development tools
- See the quick start guide for API Builder
- There's a lot more info about developing API Builder apps in the documentation, so make sure to check it out
- Sign up for an Azure account
- Create the API Builder VM from the Azure marketplace.
- Ensure port endpoints 80, 8080, and 443 are open (They should already be). Instructions here.
Running the Publishing Server
The API Builder VM is installed on a normal Ubuntu 14.04 Linux server. You can use it like you would any Ubuntu server. One important thing to note: To start/stop the API Builder publishing features manually, there is an init.d/arrowd script that can be run. e.g. `sudo /etc/init.d/arrowd start` will start the publishing server on your VM, so you can easily publish your API Builder app to it. The publishing service allows you to easily publish your app to the VM without having to jump on your VM and manually install the API Builder and app and run it. Because this is in the init.d directory, it should auto-start the publishing service automatically.
Developing an API Builder app for Azure is the same as developing an API Builder app for Appcelerator's cloud. You develop locally on your machine and when you're ready to publish, you will use the Appcelerator CLI to publish the app to the Azure VM. For guides on how to build an API Builder app, please refer here.
To publish an API Builder app to the AzureVM:
- In the command line go to the API Builder project. i.e. cd /path/to/your/project
- Run the command: appc publish <url to your VM>:8080/<deploy id> e.g. appc publish
- The app should then deploy to your VM and be running on port 80 so you should be able to visit: and see your app running
SPECIAL NOTE: As of this writing, you must use version 5.2.0-55 or newer of the CLI to publish to Azure. To use this version, run the following command: appc use 5.2.0-55 . You can check your version via: appc -v
For security reasons, the VM's deploy ID is required to publish to the Azure VM. You can find the deploy ID two ways:
- ssh in to the Azure VM and you'll find the deploy ID here: /var/lib/cloud/data/instance-id . You can quickly read it via cat /var/lib/cloud/data/instance-id
- The Azure Portal will have the deploy ID of your VM by navigating to your VM and finding the deploy ID on the right side. (see screenshot below)
Once you have that, per the instructions above, you can run the appc publish command to publish your app.
If you need to unpublish the API Builder app from your VM, you can run the following command:
appc unpublish <url to your VM>:8080/<deploy id>
e.g. appc unpublish