Service Configuration

1. Description

Service Configuration is an Environment Configuration that is dedicated to averos services.
A service configuration defines the service-to-api bindings by specifying the api location details to which the service is linked.

Averos services relies only on service configurations in order to bind itself to a specific api.
Thus, every averos service should be linked to either a service configuration or a gateway configuration which is described in the next section.

This service-to-api binding defines the target api to be bound to throught a set of attributes that specifies its location.

A Service Configuration instance is composed of the following attributes that defines the api location mapping:

  • id : defines the configuration identifier. Should match the related service class name.
  • apiHost: defines the target api host
  • apiPort: defines the target api listening port
  • apiProtocol: defines the api protocol (http, https)
  • apiEndPoint: defines the target api uri

Service Configurations are a great way to create or update the service-to-api bindings without the need to modify or redeploy the application. A simple application reload will apply the changes to the application.

2. Workflow Command: averos-config

a. Description

Adding an averos business service could be achieved either manually or by means of the dedicated workflow command averos-config.

🚩 We recommend using “averos-config” command while binding services to apis so that the required guidelines aspects along with the related validations could be done automatically.

b. Command Usage

Below is the full detailed workflow command line:

ng g @wiforge/averos:averos-config --id=MyService --type=service --host=127.0.0.1 --port=8888 --protocol=https --endpoint=/srv1

Input Parameters

  • id: Mandatory. Defines the class name of the related service
  • type: Mandatory / fixed value: service. Defines the type of the configuration. Equal to service
  • host, port, protocol, endpoint: api location attributes

c. Output

The command will result in the creation of a service-to-api binding.