Go to file
Erika Rowland c7b8b6185a it works 2024-03-30 23:43:37 -07:00
src it works 2024-03-30 23:43:37 -07:00
test it works 2024-03-30 23:43:37 -07:00
.gitignore it works 2024-03-30 23:43:37 -07:00
README.md it works 2024-03-30 23:43:37 -07:00
gleam.toml it works 2024-03-30 23:43:37 -07:00
manifest.toml it works 2024-03-30 23:43:37 -07:00

README.md

Wisp Example: Routing

gleam run   # Run the server
gleam test  # Run the tests

This example shows how to route requests to different handlers based on the request path and method.

This example is based off of the "Hello, World!" example, so read that one first. The additions are detailed here and commented in the code.

app/router module

The handle_request function now pattern matches on the request and calls other request handler functions depending on where the request should go.

app_test module

Tests have been added for each of the routes. The wisp/testing module is used to create different requests to test the application with.

Other files

No changes have been made to the other files.