@aexol/syncano-middleware-in-socket
v0.0.4
Published
Load middleware stack from socket.
Downloads
5
Readme
name
Run middlewares from socket.
Description
Run middlewares defined in socket.yml.
Synopsis
Example usage:
import serve, {response} from '@aexol/syncano-middleware'
import {fromSocket} from '@aexol/syncano-middleware-in-socket'
export default ctx => serve(ctx, fromSocket(async (ctx, syncano) => {
return response.json({})
}))
API
fromSocket(fn, [opts]) ⇒ HandlerFn
Kind: global function
Export:
| Param | Type | Description | | --- | --- | --- | | fn | HandlerFn | next function in chain | | [opts] | Object | extra options | | [opts.paths] | PathsType | socket info search override |