| Copyright | (c) 2017 Quixoftic LLC |
|---|---|
| License | BSD3 |
| Maintainer | Drew Hess <dhess-src@quixoftic.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Mellon.Web.Server.API
Contents
Description
- type MellonAPI = ("time" :> Get '[JSON, HTML] Time) :<|> (("state" :> Get '[JSON, HTML] State) :<|> ("state" :> (ReqBody '[JSON] State :> Put '[JSON, HTML] State)))
- data State
- newtype Time = Time UTCTime
- app :: Controller d -> Application
- mellonAPI :: Proxy MellonAPI
- server :: Controller d -> Server MellonAPI
Types
type MellonAPI = ("time" :> Get '[JSON, HTML] Time) :<|> (("state" :> Get '[JSON, HTML] State) :<|> ("state" :> (ReqBody '[JSON] State :> Put '[JSON, HTML] State))) Source #
A Servant API for interacting with a Controller.
In addition to the controller methods, the API also provides a way to obtain the system time on the server, to ensure that the server's clock is accurate.
Mimics State, but provides JSON conversions.
(Avoids orphan instances.)
A newtype wrapper around UTCTime, for serving HTML without
orphan instances.
Servant / WAI functions
app :: Controller d -> Application Source #
A WAI Application which runs the service, using the
given Controller.