Type alias ServerOpts<Meta>

ServerOpts<Meta>: { authenticate?: ((authentication: Authentication) => boolean); defaultAuthentication?: Authentication; middlewares?: Middleware<Meta>[]; port: number; restMiddleware?: RestMiddleware[]; staticFiles?: StaticFileOpts }

Options passed to createApiServer for running your server

Params

Meta The custom Metadata type

Type Parameters

Type declaration

  • Optional authenticate?: ((authentication: Authentication) => boolean)
      • (authentication: Authentication): boolean
      • Method to take in authentication data and return whether the user is allowed

        Parameters

        Returns boolean

  • Optional defaultAuthentication?: Authentication

    Default Authentication metadata (as in, if {type: "bearer", token: ""} is provided, estuary-rpc-server will attempt to extract a bearer token from all requests, and only allow requests to complete if that token results in the authenticate method passes, or unless the metadata specifically assigns authentication for a given endpoint to null)

  • Optional middlewares?: Middleware<Meta>[]

    Midlewares to execute while executing all endpoints, using a complet ApiContext and Metadata definition

  • port: number

    Port number your server is bound to

  • Optional restMiddleware?: RestMiddleware[]

    Middlewares to execute before executing REST endpoints, using only data available in the IncomingMessage

  • Optional staticFiles?: StaticFileOpts

    See StaticFileOpts for usage around serving staticfiles in common patterns

Generated using TypeDoc