JSPM

@kronos-integration/service-http

10.4.8
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1563
  • Score
    100M100P100Q117143F
  • License BSD-2-Clause

http server

Package Exports

  • @kronos-integration/service-http

Readme

npm License minified size downloads Styled with prettier Commitizen friendly

kronos-service-koa

koa backed http server

API

Table of Contents

ServiceHTTP

Extends Service

HTTP server

Properties

  • server http.Server only present if state is running

extendetName

Returns string name with url

endpointFactoryFromConfig

On demand create RouteSendEndpoint´s

Parameters

Returns Class RouteSendEndpoint if path is present of name starts with '/'

name

Returns string 'http'

HTTPEndpoint

Extends SendEndpoint

Endpoint to link against a http route.

Parameters

  • name string endpoint name
  • owner Object owner of the endpoint
  • options Object (optional, default {})
    • options.path string url path defaults to endpoint name
    • options.method string http method defaults to GET

WSEndpoint

Extends SendEndpoint

Endpoint to link against a websocket route

Parameters

  • name string endpoint name
  • owner Object owner of the endpoint
  • options Object (optional, default {})
    • options.path string url path defaults to endpoint name

Properties

authenticate

check sec-websocket-protocol header for presence of 'access_token' and the token. Throws if no valid token is present

Parameters

  • service Service
  • request any

CTXInterceptor

Extends Interceptor

Basic interceptor providing/consuming http request/response.

name

Returns string 'ctx-body-param'

CTXBodyParamInterceptor

Extends CTXInterceptor

Extracts params from request body. Supported content types are:

  • application/json
  • application/x-www-form-urlencoded

name

Returns string 'ctx-body-param'

CTXJWTVerifyInterceptor

Extends Interceptor

Only forward requests if a valid JWT token is present.

name

Returns string 'ctx-jwt-verify'

reportError

Write WWW-Authenticate header

Parameters

  • ctx any
  • error any
  • description any

install

With npm do:

npm install kronos-service-koa

license

BSD-2-Clause