HTTP server https://github.com/okue/haskyapi#readme
|Latest on Hackage:||0.0.0.2|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
What is Haskyapi?
Haskyapi is a HTTP server implemented in Haskell.
$ stack build $ stack install $ haskyapi migrate $ haskyapi runserver --port 8080 --root . root: . listen on 8080 http://localhost:8080/ http://localhost:8080/index.html http://localhost:8080/hoge.md
$ cabal build
-p, --port: port number
-r, --root: root directory
-h, --help: help
setting.yml is a configuration file for these options.
How to use as web framework
app/Main.hs in this repository is an example program using haskyapi as web framework.
Here is a very simple example.
module Main where import Web.Haskyapi.Console.Cli (haskyapi) import Web.Haskyapi.Header ( Api, ApiFunc, -- type of api functions Method(..), -- GET, POST, ... ContentType(..) -- Cplain, Cjson, ... ) routing :: [Api] routing = [ (GET, "/test", test, Cplain) ,(POST, "/test", test, Cplain) ] test :: ApiFunc test qry _ = return "This is GET." test qry _ = return "This is POST." main = haskyapi routing
- [x] Open Markdown file
- [ ] Use Database easily
- [ ] Implement RESTful api easily
- [ ] Automatic generator of api reference document
- [ ] HTTPS
.haskyapi.bash is a bash-completion setting file for haskyapi command.
Haskyapi works at okue.site:80