caddy_browse

An API client for Caddy’s browse directory listings

Package Version Hex Docs

gleam add caddy_browse@1
import caddy_browse
import gleam/http/request

pub fn main() {
  // Prepare a HTTP request to a directory served by a Caddy server
  // that has browse enabled
  let assert Ok(request) = request.to("https://example.com/some/path")
  let request = caddy_browse.request(request)

  // Send it with your HTTP client
  let assert Ok(response) = your_http_client.send(request)

  // Parse that to get the directory listing
  caddy_browse.response(response)
}

Further documentation can be found at https://caddy-browse.hexdocs.pm/.

Search Document