espresso/query

Helper module for extracting query parameters from a request.

Functions

pub fn get(req: Request(a, b), name: String) -> Option(String)

Get a query parameter from a request.

Examples

import espresso/request.{Request}
import espresso/query

fn handler(req: Request(a)) {
 let name = query.get(req, "name")
 case name {
   Some(name) -> ...
   None -> ...
 }
}
Search Document