22 lines
516 B
Haskell
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
|