List Express API

You can use List Express API to link the client UI(especially editors like Select or SuggestBox with remote data source) and sever data model.

List Express API helps to perform the next requests:

Method URL Description
GET / Get all records
GET /label/:recordId Get particular record label


  const listApiBuilder = UIKernel.listExpressApi();    //initializes builder

Builder methods



Specify a list model which must implement List Model Interface and can be an instance or a constructor so that the List Express Api will be able to use the provided data model to perform client requests.


Type Name Description
FormModel listModel Required. The instance of a List model


Type Name Description
Function getModel Required. Function to be called with Express middleware’s req and res parameters returning a List model instance



Specify a function to be called when the response is ready.


Type Name Description
Function callback Optional. Function to be called with the result.

callbacks arguments:

Type Name Description
Any err Error caught from model methods
Any data Result returned by model methods


  const router = listApiBuilder.getRouter();

Creates an Express router object with middlewares performing requests specified above.

Usage Example

Pass a model instance to Express API:

  import citiesListModel from 'somewhere';
  const router = UIKernel.listExpressApi()

Or use a constructor for that:

  import CitiesListModel from 'somewhere';
  const router = UIKernel.listExpressApi()
    .model((req, res) => {
      return new CitiesListModel(req.params.countryId);

You can also customize your API by adding other methods or define API using other frameworks.

To interact with this API at front-end use List XHR Model.

Example of customizing provided API with your own methods

  import model from 'somewhere';
  const router = UIKernel.gridExpressApi()
    //here you can add performing of some other API requests:
    .put('/:recordId', function (req, res, next) {
        .then(function () {
        .catch(function (err) {