Hi guys,
I would like to run my API in this stack:
MyApp a = ReaderT AppConfig (ExceptT ServantErr IO) a
How do I need to configure the rest? I tried:
type ServerW api = ServerT api HandlerW
newtype HandlerW a = HandlerW { runHandlerW :: MyApp a }
deriving
( Functor, Applicative, Monad, MonadIO, Generic
, MonadError ServantErr
, MonadThrow, MonadCatch
)
type MyAPI = "api" :> "v1" :> Get '[JSON] [Perm]
server :: ServerW MyAPI
server = undefined
Is this correct?
With my attempt so far, I cannot combine different "ServerW" with the operator :<|> :
server :: ServerW MyAPI
server = Server1 :<|> Server2
• Couldn't match type ‘ReaderT
AppConfig (ExceptT ServantErr IO) ()’
with ‘HandlerW Token’
Expected type: ServerW ()
Actual type: (MyApp ())
:<|> (MyApp ())