Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 414 Bytes

ZERO-BS.md

File metadata and controls

27 lines (18 loc) · 414 Bytes

Zero BS

Simple webserver library.

import Zero.Server

helloHandler :: Handler
helloHandler
  = simpleHandler GET "/hello" (\req -> stringResponse "hello")

pingHandler :: Handler
pingHandler
  = simpleHandler GET "/ping" (\req -> stringResponse "pong")

main :: IO ()
main
  = startServer [ helloHandler, pingHandler ]

curl localhost:7879/hello
hello

curl localhost:7879/ping
pong