@aexol/syncano-middleware-in-socket

Load middleware stack from socket.

Usage no npm install needed!

<script type="module">
  import aexolSyncanoMiddlewareInSocket from 'https://cdn.skypack.dev/@aexol/syncano-middleware-in-socket';
</script>

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