🕵 ️
http2configuration These are the schemas for http2server configuration files. They are shared between various related projects. This package acts as versioned truth, i.e. common ground.
ConfigurationValidator
Class
Instance of the Validator
class from jsonschema
. Restricted to custom schemas and formats.
import {ConfigurationValidator} from 'http2configuration'
const validator = new ConfigurationValidator()
const configuration = { hosts: [ { domain: 'http2.live', root: 'public' } ] }
// Throws the first encountered error if the configuration syntax is invalid,
// otherwise returns `true`.
validator.validate(configuration)
JSON Schemas
options
The overall options schema defines the main structure of a configuration file.
import optionsSchema from 'http2configuration/schema/options'
host
The schema specifically for validating a host
section of the configuration.
import hostSchema from 'http2configuration/schema/host'
manifest
Schema to validate the server push manifest configuration.
import hostSchema from 'http2configuration/schema/manifest'