espresso

This package is experimental and likely to change. Use at your own risk

Package Version Hex Docs

A simple to use HTTP server built on top of erlang’s cowboy.

import espresso
import espresso/request.{Request}
import espresso/response.{send}
import espresso/router.{get}

pub fn main() {
  let router =
    router.new()
    |> get("/", fn(_req: Request(BitString)) { send(202, "Main Route") })

  espresso.start(router)
}

Environment Variables

Quick start

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell

Installation

If available on Hex this package can be added to your Gleam project:

gleam add espresso

and its documentation can be found at https://hexdocs.pm/espresso.

Search Document