This package has been deprecated

Author message:

This package has moved to @commonshost/configuration See: https://www.npmjs.com/package/@commonshost/configuration

@http2/configuration

5.5.1 • Public • Published

@http2/configuration ⚙️

These are the schemas for @http2/server configuration files. They are shared between various related projects. This package acts as the versioned reference.

ConfigurationValidator Class

Instance of the Validator class from jsonschema. Restricted to custom schemas and formats.

const {ConfigurationValidator} = require('@http2/configuration')

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.

const optionsSchema = require('@http2/configuration/schema/options')

host

The schema specifically for validating a host section of the configuration.

const hostSchema = require('@http2/configuration/schema/host')

manifest

The HTTP/2 Server Push Manifest schema is available in @http2/manifest and used to validate the manifest property of a host.

const {schema: manifestSchema} = require('@http2/manifest')

Readme

Keywords

Package Sidebar

Install

npm i @http2/configuration

Weekly Downloads

1

Version

5.5.1

License

ISC

Unpacked Size

14.5 kB

Total Files

14

Last publish

Collaborators

  • seb