Skip to content
Snippets Groups Projects
Lib.hs 453 B
Newer Older
  • Learn to ignore specific revisions
  • {-# LANGUAGE DataKinds       #-}
    {-# LANGUAGE TemplateHaskell #-}
    {-# LANGUAGE TypeOperators   #-}
    module Lib
        ( startApp
        , app
        ) where
    
    import Data.Aeson
    import Data.Aeson.TH
    import Network.Wai
    import Network.Wai.Handler.Warp
    import Servant
    
    
    type API =
      "webhook" :> Post '[JSON] ()
    
    
    startApp :: IO ()
    startApp = run 8080 app
    
    app :: Application
    app = serve api server
    
    api :: Proxy API
    api = Proxy
    
    server :: Server API