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 |
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: