If you remove comment out: fromServant <- makeHandler (serve itemApi server) event & ++ ByteString.unpack fromServant in src/Lib.hs the package will compile. Otherwise it fails with a linking error.
handler :: Event -> Context -> IO (Either String Response)
handler event context = do
fromServant <- makeHandler (serve itemApi server) event
pure $ Right Response
{ statusCode = 200
, body = "test: " ++ ByteString.unpack fromServant
}
Check out the branches
persistent
andbeam
: https://github.com/Jimbo4350/serverless-servant-faultyIf you remove comment out:
fromServant <- makeHandler (serve itemApi server) event
&++ ByteString.unpack fromServant
insrc/Lib.hs
the package will compile. Otherwise it fails with a linking error.