rally/runtime/http_server

Types

pub type Config {
  Config(
    websocket_path: String,
    asset_prefix: String,
    admin_prefix: String,
  )
}

Constructors

  • Config(
      websocket_path: String,
      asset_prefix: String,
      admin_prefix: String,
    )
pub type Handlers(context) {
  Handlers(
    auth: fn(request.Request(mist.Connection), context) -> Result(
      response.Response(mist.ResponseData),
      Nil,
    ),
    websocket: fn(request.Request(mist.Connection), context) -> response.Response(
      mist.ResponseData,
    ),
    admin: fn(request.Request(mist.Connection), context) -> response.Response(
      mist.ResponseData,
    ),
    public: fn(request.Request(mist.Connection), context) -> response.Response(
      mist.ResponseData,
    ),
  )
}

Constructors

Values

pub fn default_config() -> Config
pub fn handle(
  req req: request.Request(mist.Connection),
  context context: context,
  config config: Config,
  handlers handlers: Handlers(context),
) -> response.Response(mist.ResponseData)
pub fn listen(
  port port: Int,
  context context: context,
  config config: Config,
  handlers handlers: Handlers(context),
) -> Nil
Search Document