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
HandlerFn
fromSocket(fn, [opts]) ⇒ Kind: global function
Export:
Param | Type | Description |
---|---|---|
fn | HandlerFn |
next function in chain |
[opts] | Object |
extra options |
[opts.paths] | PathsType |
socket info search override |