JSPM

@kronos-integration/service-http

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

http server

Package Exports

  • @kronos-integration/service-http

Readme

npm License minified size downloads Build Action Status semantic-release Styled with prettier Commitizen friendly Known Vulnerabilities

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 {})

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 Interceptor

Extracts params from request body

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