Table of Contents |
---|
Note |
---|
The content on this 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. |
...
- Download and install Node.js from http://nodejs.org/#download, which includes the npm package manager needed to install the Appcelerator CLI.
From a console window, run the following command to install the CLI:
Code Block [sudo] npm install appcelerator -g
After installation, run the setup command to install required components:
Code Block appc setup
After the CLI downloads and installs the required components, you will be prompted to loginlog in, select an organization to log into, and asked you will be developing Titanium apps. If this is your first time using Appcelerator Studio, the CLI will ask to send an authorization token to your e-mail account or a text to your mobile phone. Enter the authorization token once you receive it to complete the registration process.
...
![]() | Summary | Your app's admin home page. |
![]() | Connectors | Lists and filters installed connector. |
![]() | Models | Interface to help you build models. A model represents data stored from another source. |
![]() | API Doc & Test | Auto-generated documentation about your API endpoints. Provides help for the client application to access your application. |
![]() | Configurations | Lists configuration files that you can modify and save within a browser. |
![]() | Logs | Lists of access logs, clients trying to access your application. |
![]() | View Documentation | Links to Appcelerator's documentation site for API Builder's guide. |
![]() | Sidebar toggle | Toggles the width of the sidebar. |
You can disable the Admin Console by changing the configuration settings in the conf/default.js
file. For now, let's explore some of the features of the Admin Console.
...
- Click the
Models button.
- Click the + Model button on the right side.
- In theNew Model step,
- Enter "simpleuser" in the Model name field (required). The name must be unique for all of the application's models.
- Select a Connector from the drop-down list (required). Connectors are use used to persist data to the model.
- Add a description.
- Click Next to move onto the fields step
- Enter "simpleuser" in the Model name field (required). The name must be unique for all of the application's models.
- In the Create Model Fields step,
- Click the + Field button.
- Enter "first_name" in the Field name field (required).
- Set Type to String.
- Leave Default value empty.
- Add a description.
- Check the boxes for Read-only or Required as necessary.
- Click the Add field to model button.
- Repeat step 4 as necessary to add the "last_name" and "email" fields to this model. After you add the fields, you can configure them by changing properties or adding validation or return logic.
- In the API endpoint page,
- Make sure the Create, Retrieve, and Update methods are checked. Since the Delete method is not checked, the
DELETE api/simpleuser
endpoint will not be generated but all the other default endpoints for this model will be. - Click Save to commit your new model to the app.
- Make sure the Create, Retrieve, and Update methods are checked. Since the Delete method is not checked, the
...
Now that you have created a simpleuser the simpleuser model, let's try to retrieve the model data from the application. In the Admin Console:
...