API Builder Console

Introduction

The Admin Console allows you to create applications and allows you to manage the data in your applications.

By default, when you create a new project and run it locally, the Admin Console is enabled and available using the http://localhost:8080/console path. You should navigate to the Admin Console in your web browser to view what the API Builder UI has to offer.

Configuration

To configure access to the Admin Console, open the project's ./conf/default.js file and edit the admin key. The admin key is a dictionary of key-value pairs that control the access to the Admin Console, such as restricting which hosts can access the Admin Console.

The admin dictionary can contain the following keys:

Key
Type
Default
Description
allowedHosts Array<String> - Restrict access to the Admin Console to the specified hosts.
enabled Boolean true Set to true to enable the Admin Console.

Example:

./conf/default.js
    // Control the settings for the @axway/api-builder-admin UI console
    admin: {
        // Control whether the admin website is available
        enabled: true,
        // The hostnames or IPs from which connections to admin are allowed. Hostnames must be resolvable on the
        // server. IP ranges can also be specified. e.g. [ 'localhost', '192.168.1.0/24', '10.1.1.1' ]
        // An empty list [] will allow unrestricted access, though this is not recommended due to security
        // concerns.
        allowedHosts: [
            'localhost', '::1'
        ]
    },

API Builder tabs

API Builder provides a list of tabs on the left-hand side that helps you get started building your applications. Click the different sections of the UI to hop between functions and features of API Builder.

Summary

The Summary tab lists basic information about your application like app name, version, description, author, license, and API key.

API Doc & Test

On startup, API endpoints are automatically generated for all models as per their default configuration. An API provides a way for a client to access your application, such as GET <SERVER_ADDRESS>/api/users/query, execute custom logic, internally access the application's models and APIs, and return data back to the client application. 

The API Doc & Test tab in the Admin Console contains generated docs of your application APIs including how to call the API, multiple examples and the ability to test the APIs. The generated docs use the information in the description fields of your JavaScript definition files to fill in some of the information. API definitions can also be imported by selecting the + API button. You can import an API from a Swagger definition by either selecting a file from your local filesystem or entering a URL. For additional information, refer Manage Endpoints.

Models

A Model is the data model, backed by a connector, and exposed as an API endpoint. A model can consist of other models or fields from other models. Once again, API Builder will generate API endpoints for your models by default. Changes to models require a restart.

The Models tab lets you create new models. The model build process involves the following steps:

  1. Name your new model, select a connector, and add a description.
  2. Add fields to your new model.
  3. Select the auto-generated API endpoint.

You may only build models when executing the project locally. The build console will not work in production even if you enable the Admin Console in production.

See the Create a new model section of API Builder Getting Started Guide for instructions on how to create a new model. For additional information on creating, editing, and composing models, refer to Models.

Configurations

The Configurations tab displays the list of configuration files on the API Builder instance. You can edit the configuration files here.

Note: Edits to these files will trigger a server restart once the files have been saved.

See Project Configuration for an example and settings.

Connectors

Connectors are responsible for reading and writing data to a specific data source (for example, MySQL or your own backend system). Each model has one connector. You can also create your own custom connectors.

Information and search

Most API Builder tabs include the title of the page followed by an information icon and a search bar. The information icon, when clicked, will display a short description of its function and/or purpose. 

To locate a particular record, enter a search term in the search bar at the top to filter the table or click Advanced to restrict the search to a specific model field.

Related Links