The content on page is for the beta release of API Builder 1.10.0. You may find some information is either missing, incomplete , or in general draft state.
An A Connector project is similar in structure to a project. This guide covers how to manage your Connector project.
|Entry point to the connector for testing, which launches a server instance.|
|Project configuration file. Do not modify this file.|
|Contains configuration files in JSON format for the connector. The |
|Entry point to the connector.|
|Contains the logic for your connector. Requires an |
|Contains generated log files when running your project locally. If you test the connector, the generated log files will get packaged with the application. You may want to disable logging by setting the |
|Contains project dependencies. API Builder automatically installs any project dependencies declared in the |
|NPM configuration file to declare project dependencies and other build or runtime configurations.|
- Select Component for the type of component
- Select Connector for the component
- Select Empty Connector Project to use a boiler plate boilerplate project.
- Enter a name and directory name for your project.
Place all the connector logic in the
lib folder. There must be an
index.js file in your
lib folder, which is the first file loaded by the connector.
The boiler plate boilerplate
index.js file expose a
create() method, which is passed the API Builder class. The method must return a Connector instance, which is created using the
Arrow.Connector.extend()method. Uncomment each Capability constant in the
extend() method an object, which implements the methods of the Connector class and a few methods from the Model class.
API Builder is based on Arrow and starting with Arrow 1.2.48 or Appcelerator CLI 4.1.3, the connector configuration object passed to the
Connect.extend() method supports a
capabilities property. The first time you run a project after adding a Capability constant to the
capabilities property, API Builder will generate boiler plate boilerplate logic, which you can modify. The table below explains what each capability constant exposes and creates. If a certain connector is not exposed through a capability, you can implement the method in the object passed to the
|Capability Constant||Location||Exposed Connector Methods|
|ContainsModels||Creates a boiler plate model in the |
If you need to add some custom initialization logic when creating the connector, implement the following methods. The The connector instance is the value passed to
this in the functions. The functions do not take any arguments or return any values:
To access data from the Connector, you need to implement the following methods. Each method is passed the Model class as it its first parameter and a callback as its last parameter. After completing the operation, invoke the callback function and pass it an Error object (or null if successful) as the first parameter, and the results of the operation as the second parameter. None of the methods have a return value.