1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE TemplateHaskell #-}
4{-# LANGUAGE TypeOperators #-}
6import Servant.API ((:<|>), (:>), Capture, Get, JSON, Post, ReqBody)
7import Servant.Elm (DefineElm (DefineElm), ElmOptions(urlPrefix),
8 Proxy (Proxy), UrlPrefix(Static), defaultOptions,
9 defElmImports, defElmOptions, deriveBoth,
10 generateElmModuleWith)
16deriveBoth defaultOptions ''Book
18type BooksApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book
19 :<|> "books" :> Get '[JSON] [Book]
20 :<|> "books" :> Capture "bookId" Int :> Get '[JSON] Book
22myElmOpts :: ElmOptions
23myElmOpts = defElmOptions { urlPrefix = Static "http://localhost:8000" }
34 [ DefineElm (Proxy :: Proxy Book)
36 (Proxy :: Proxy BooksApi)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list