yaschema-ws-api
TypeScript icon, indicating that this package has built-in type declarations

2.2.5 • Public • Published

yaschema-ws-api

Downloads Size

Web socket API support for yaschema.

Basic Example

export const stream = makeWsApi({
  routeType: 'stream',
  url: '/stream',
  requests: {
    ping: schema.object({ echo: schema.string().allowEmptyString().optional() }).optional(),
    hello: schema.any().optional()
  },
  responses: {
    pong: schema.object({
      body: schema.string()
    }),
    hello: schema.object({
      body: schema.string()
    })
  }
});

Thanks

Thanks for checking it out. Feel free to create issues or otherwise provide feedback.

API Docs

Be sure to check out our other TypeScript OSS projects as well.

/yaschema-ws-api/

    Package Sidebar

    Install

    npm i yaschema-ws-api

    Weekly Downloads

    18

    Version

    2.2.5

    License

    MIT

    Unpacked Size

    41.1 kB

    Total Files

    135

    Last publish

    Collaborators

    • bwestphal