Install the API Gateway

Installation prerequisites

This service provides a REST and oAuth2 development interface so that third-party developers and organizations can create products that interact with the SpinalCore BOS.

To install the API server it is necessary to have the following configuration:

  1. Make sure your SpinalCore installation and the associated extensions are the latest supported versions. (Install your system )

  2. Nodejs + npm installed on your linux distribution

  3. PM2 (process manager) install globally on your server or virtual machine. (Install your system)

Installation & configuration

Once the SpinalCore system is installed, please do the following :

Installation :

Install: npm install

Configuration :

In the BOS configuration file : spinal-api-gateway/config.js

The configurations to modify in the file are :

spinalConnector: {

user: process.env.SPINAL_USER_ID || 168, // user id

password: process.env.SPINAL_PASSWORD ||

"3HNvC6fftqHz", // user password

host: process.env.SPINALHUB_IP || "localhost", // can be an ip address

port: process.env.SPINALHUB_PORT || 7777 // port


api: {

host: process.env.REQUESTS_HOST || 'localhost', // internal port

port: process.env.REQUESTS_PORT || 3000 // internal port


file: {

// path to a digital twin in spinalhub filesystem

path: process.env.SPINAL_DTWIN_PATH || '/__users__/admin/Digital twin',


contexts: ['GeographicContext', 'TicketContext', 'BuildingContext']

In the spinal-api-gateway configuration file : spinal-api-gateway/config/gateway.config.yml

The configurations to modify in the file are :


port: 8000


port: 9889

host: localhost




- /api-docs

host: '*'



- /admin

host: '*'



url: 'http://localhost:3000'


- basic-auth

- cors

- expression

- key-auth

- log

- oauth2

- proxy

- rate-limit

pipelines: null

Start the system :

Go to the directory containing the information system modules via the console :

spinalcom-system $> pm2 start launch.config.json

Configure of API Gateway

The Configure the API Gateway section describes the Admin UI.