A simple API on top of the Mist webserver
If available on Hex this package can be added to your Gleam project:
gleam add howdy
and its documentation can be found at https://hexdocs.pm/howdy.
import gleam/erlang
import howdy/server
import howdy/router.{Get}
import howdy/response
pub fn main() {
let _ = server.start(Get("/", fn(_) { response.of_string("Hello, World!") }))
erlang.sleep_forever()
}
See router documentation for more details here