Building a Cúram REST API

After creating the REST configuration file, the next step in the process of creating a REST API is to build and run the API resources in the development environment by using Tomcat.

Before you begin

You must have completed the modeling, Java implementation, and creation of the REST configuration file for your REST resources.

Procedure

  1. Set the CATALINA_HOME environment variable. This environment variable defines the home directory of the Tomcat installation, and is used to automatically deploy the REST API resources into Tomcat.
  2. From the %CURAM_DIR%/EJBServer directory, run the following command-line command:
    build rest
    %CURAM_DIR% is the Cúram installation directory, which by default is C:\IBM\Curam\Development. This target combines the defined REST resources from each component and deploys the REST API to the Tomcat web server in the development environment.
  3. Using a web browser, open the following URL to confirm successful deployment of the REST API:
    http://localhost:9080/Rest/api/definitions

    Where 9080 is the default Tomcat port.

    A list of the Swagger documents for each version of the API defined is displayed. Select a version to open the Swagger document for that version.

  4. Using a web browser, open the following URL to confirm whether the /notes GET resouce method is working:
    http://localhost:9080/Rest/v1/notes

    A JSON object with an array of notes is displayed.

What to do next

Test the REST APIs using Junit or another unit testing tool.