api.rauhala.info/src/Server.hs
2018-09-24 23:36:26 +03:00

22 lines
516 B
Haskell

{-# Language NoImplicitPrelude #-}
{-# Language TypeApplications #-}
{-# Language OverloadedStrings #-}
{-# Language GeneralizedNewtypeDeriving #-}
module Server where
import API
import ClassyPrelude
import Servant
import qualified Servant.Docs as Docs
import qualified Server.IPFS as IPFS
server :: Server DocumentedAPI
server = IPFS.handler :<|> pure mkDocs
where
mkDocs = Docs $ pack $ Docs.markdown $ Docs.docs (Proxy @API)
application :: Application
application = serve (Proxy @DocumentedAPI) server