Current section
Files
Jump to
Current section
Files
README.md
# glen<img src="./assets/glen.png" width="150" align="right" />[](https://hex.pm/packages/glen)[](https://hexdocs.pm/glen/)🏕️ A peaceful web framework for Gleam that targets JS.✨ Features:- Request & response helpers- Helpful middleware- File streaming- Bring-your-own server _(optional)_- Easily deploy on serverless platforms such as [Deno Deploy](https://deno.com/deploy)...and other nice-to-haves!## InstallationInstall all requirements:```shgleam add glen gleam_http gleam_javascript```Or just Glen:```shgleam add glen```## Usage```gleamimport gleam/javascript/promise.{type Promise}import gleam/httpimport glenimport glen/statuspub fn main() { glen.serve(handle_req, 8000)}fn handle_req(req: glen.Request) -> Promise(glen.Response) { "<h1>Welcome to my webpage!</h1> <p>Make yourself at home 😄</p>" |> glen.html(status.ok) |> promise.resolve}```Glen is heavily based off of [Wisp](https://github.com/gleam-wisp/wisp), and many of Wisp's [examples](https://github.com/gleam-wisp/wisp/tree/main/examples) can easily be ported to Glen. Glen also has an example application of its own in [./test](./test/).Further documentation can be found at <https://hexdocs.pm/glen>.## Development```shgleam run # Run the projectgleam test # Run the example application```