Operation

This document covers the following topics:


Starting and Stopping the Server

To start or stop the Natural OpenAPI Server using the embedded webserver delivered with the NaturalOpenAPIServer.war file, navigate to the installation folder /NaturalOpenAPIServer/bin/ and run the startup.sh or shutdown.sh shell script respectively.

Deploying Web Application with Tomcat

The following are some specific configurations for Apache Tomcat® if you want to deploy the Natural OpenAPI Web application with your own Tomcat.

Deploying War File

The NaturalOpenAPIServer.war must be copied to the /tomcat/webapps/ directory.

In addition, the SPRING_CONFIG_LOCATION environment variable must be configured to point to the location of the application.properties file.

Configuring Server.XML

Alternatively, the following configuration can be added to the Tomcat's server.xml file when deploying the Natural OpenAPI Server.

<Context path="/noa1" docBase="noa1" override="true">
      <Environment name="SPRING_CONFIG_LOCATION" value="/your-path/conf/application.properties" type="java.lang.String" />
</Context>

Deploying OpenAPI Resources

To deploy the services described in the Developer Overview > Generating OpenAPI Resources section, the Natural OpenAPI Server must be configured with the location of the service files.

The service file location can be configured in the following ways:

  • Using natural.integration.services.directory – Set this property in the application.properties file to specify the directory containing the service files. Place the service files in the specified directory.

  • Using natural.integration.services.files – Set this property to specify the names of the specific service files to be deployed. The specified files must be located in the classpath of the application.

When the Natural OpenAPI Server starts, it loads the configured service files and registers the OpenAPI services defined in those files.

Each service file contains the definition and mapping information required to expose a Natural subprogram as a REST API service. Once the server has successfully started, all services defined in the loaded service files are available to clients through the Natural OpenAPI Server. For more information, see the management.endpoints.web.exposure.include parameter in the General Configuration section.

Adding or modifying a service therefore requires updating the corresponding service file and restarting the server or using the reload actuator endpoint for the changes to be loaded and the services to become available.