logo
首页技术栈工具库讨论
firefly-example

firefly-example

For package maintainers and hackage trustees Firefly is dead simple http framework written in Haskell. It strives for simplicity in implementation (and in use). It's great for people learning Haskell, fiddling with Monads, or who just need a really simple server for something. Here's the minimal app: Just that easy! Check out the Example App for more! Specify your routes using regex patterns, the first one which matches will run. Handler is a monad with access to the incoming request. You can access parts of it using helpers, then return a response. Here are some valid response types and their inferred Content-Type There are more in Web.Firefly.Response. You can specify your status code using (body, Status) where body is any of the above types and Status is an Integer status code. Or, add headers too with (body, Status, HeaderMap) where HeaderMap is a map of names to values. Let's write some more interesting handlers: Here's an example of responding with JSON: You should use Firefly if: Don't use Firefly if:
由 
bruceshi2021-01-13 收录
--
推荐
不推荐
更多信息
GitHub iconChrisPenner/Firefly82
HACKAGE
carbal install firefly-example
查看
标签
根据用户添加的标签生成
暂无标签