Next: , Previous: , Up: Hello World   [Contents]

5.5 Regex in URL remapping

You can use regex in the URL rule.

(use-modules (artanis artanis))
(init-server)
(get "/.+\\.(png|gif|jpeg)" static-page-emitter)
(run #:port 8080)

static-page-emitter is an GNU Artanis API which emits a static file (images, data files) to the client.