Package Exports
- @kronos-integration/service-http
Readme
kronos-service-koa
koa backed http server
API
Table of Contents
- ServiceHTTP
- HTTPEndpoint
- WSEndpoint
- authenticate
- CTXInterceptor
- CTXBodyParamInterceptor
- CTXJWTVerifyInterceptor
- reportError
ServiceHTTP
Extends Service
HTTP server
Properties
serverhttp.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
WSEndpoint
Extends SendEndpoint
Endpoint to link against a websocket route
Parameters
namestring endpoint nameownerObject owner of the endpointoptionsObject (optional, default{})options.pathstring url path defaults to endpoint name
Properties
authenticate
check sec-websocket-protocol header for presence of 'access_token' and the token
Parameters
serviceServicerequestany
CTXInterceptor
Extends Interceptor
extracts params form request body
name
Returns string 'ctx-body-param'
CTXBodyParamInterceptor
Extends Interceptor
extracts params form 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
ctxanyerroranydescriptionany
install
With npm do:
npm install kronos-service-koalicense
BSD-2-Clause