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

3.1.3 • 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

    10

    Version

    3.1.3

    License

    MIT

    Unpacked Size

    36.7 kB

    Total Files

    111

    Last publish

    Collaborators

    • bwestphal