Class: Server

core/server/server~Server(config)

The Server is based on the web framework Scoutcamp. It creates an http server, sets up helpers for token persistence and monitoring. Then it loads all the services, injecting dependencies as it asks each one to register its route with Scoutcamp.

Constructor

new Server(config)

Badge Server Constructor

Parameters:
Name Type Description
config object

Configuration object read from config yaml files by https://www.npmjs.com/package/config and validated against publicConfigSchema and privateConfigSchema

Source:
See:

Methods

registerErrorHandlers()

Set up Scoutcamp routes for 404/not found responses

Source:

registerRedirects()

Set up a couple of redirects: One for the raster badges. Another to redirect the base URL / (we use this to redirect https://img.shields.io/ to https://shields.io/ )

Source:

(async) registerServices()

Iterate all the service classes defined in /services, load each service and register a Scoutcamp route for each service.

Source:

(async) start()

Start the HTTP server: Bootstrap Scoutcamp, Register handlers, Start listening for requests on this.baseUrl()

Source:

(async) stop()

Stop the HTTP server and clean up helpers

Source: