Cookbook¶
This page is a collective effort whose goal is to show how to solve many common problems with servant. If you’re interested in contributing examples of your own, feel free to open an issue or a pull request on our github repository or even to just get in touch with us on the **#haskell-servant** IRC channel on libera.chat <https://web.libera.chat/#haskell-servant>_ or on `the mailing list.
The scope is very wide. Simple and fancy authentication schemes, file upload, type-safe links, working with CSV, .zip archives, you name it!
- Structuring APIs
- Using generics
- Serving web applications over HTTPS
- Overview
- SQLite database
- PostgreSQL connection pool
- Using a custom monad
- Inspecting, debugging, simulating clients and more
- Customizing errors from Servant
- Listing alternative responses and exceptions in your API types
- Basic Authentication
- Streaming out-of-the-box
- Combining JWT-based authentication with basic access authentication
- Hoist Server With Context for Custom Monads
- File Upload (
multipart/form-data
) - Pagination
- Generating mock curl calls
- Error logging with Sentry
- How To Test Servant Applications
- OpenID Connect
- Request-lifetime Managed Resources