This page documents the schema used by config.yaml for RESTBase.
config.yaml file is basically for Service-runner, so there are three things to do: The first one is configuring Service-runner, the second one is registering a RESTBase as a service for Service-runner and the third one is configuring the RESTBase.
services Clause
- Placement
services
A list of maps for services. The services can be either RESTBase, Citoid, Mathoid or Cxserver so on. This page only treats restbase service.
This section has the same format as service-runner's services clause. See this document for details.
RESTBase Service Configurations
This section must be set as below:
services:
- name: restbase
module: hyperswitch
conf:
# ...
conf Clause
- Placement
services → * → conf
A configurations map for RESTBase, not for Service-runner.
port- TODOsalt- TODOdefault_page_size- TODOuser_agent- TODOui_name- TODOui_url- TODOui_title- TODOspec- Seespecclause below.
spec Clause
- Placement
services → * → conf → spec
A map with keys are filters or paths.
x-route-filters Clause
- Placement
services → * → conf → spec → x-route-filters
A list of filters for the allowed routes. The below filters are automatically added:
- type: default
name: metrics
- type: default
name: validator
See also #General filter configurations.
x-request-filters Clause
- Placement
services → * → conf → spec → x-request-filters
A list of filters for the allowed requests. You can use the below filters as convenience way:
- path: lib/security_response_header_filter.js
- path: lib/normalize_headers_filter.js
See also #General filter configurations.
x-sub-request-filters Clause
- Placement
services → * → conf → spec → x-sub-request-filters
Example
x-sub-request-filters:
- type: default
name: http
options:
allow:
- pattern: http://localhost/w/api.php
forward_headers: true
- pattern: http://localhost:8142
forward_headers: true
- pattern: /^https?:\/\//
General filter configurations
If type is default and name is given, filters/<name>.js is loaded.
typeTODOnameTODOoptionsTODO
paths Clause
- Placement
services → * → conf → spec → paths
A map with keys for the end points.
Path Configuration
A map that contains x modules.
x-modules Clause
A list of modules.
Module Configurations
A map.
Examples
/table module
backend must be sqlite or cassandra.
- For sqlite configuration, see https://www.npmjs.com/package/restbase-mod-table-sqlite#configuration.
- For cassandra configuration, see https://www.npmjs.com/package/restbase-mod-table-cassandra#configuration.
num_workers Clause
- Placement
num_workers
Same as Service-runner's num_workersclause, see the document for further details.
startup_concurrency Clause
- Placement
startup_concurrency
Same as Service-runner's startup_concurrency clause, see the document for further details.
worker_heartbeat_timeout Clause
- Placement
worker_heartbeat_timeout
Same as Service-runner's worker_heartbeat_timeout clause, see the document for further details.
logging Clause
- Placement
services
Same as Service-runner's logging clause, see the document for further details.
Example
logging:
name: restbase
level: info # being "trace", "debug", "info", "warn"(Default), "error" or "fatal"
metrics Clause
- Placement
metrics
Same as Service-runner's metrics clause, see the document for further details.
ratelimit Clause
- Placement
ratelimit
Same as Service-runner's ratelimit clause, see the document for further details.
dns_cache Clause
- Placement
dns_cache
Same as Service-runner's dns_cache clause, see the document for further details.
info Clause
- Placement
info
Example
info:
name: restbase
description: description