No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
scripts
src
test
.gitignore
Dockerfile
LICENSE
README.md
Setup.hs
bbn-json-hs.cabal
stack.yaml

README.md

bbn-json-hs

blog.bouzuya.net json api using haskell.

  • wai
  • warp
  • aeson
  • http-conduit

Usage

Development

$ stack exec bbn-json-hs-exe

Deployment

$ ./scripts/docker-build.sh
$ # use `-p ...:3000` or `export PORT=...`
$ docker run -p 3000:3000 bouzuya/bbn-json-hs-exe:latest

API

  • / ... all entries
  • /{yyyy}/{mm}/{dd}/ ... an entry

/

$ curl 'http://localhost:3000/' | jq .
[
  {
    "date": "2017-01-01",
    "title": "タイトル"
  }
]

/{yyyy}/{mm}/{dd}/

$ curl 'http://localhost:3000/2017/01/01/' | jq .
{
  "date": "2017-01-01",
  "title": "タイトル",
  "html": "<p>Hello</p>"
}