Handler from Aff or how to set up Express+database

Hi!
I want to run a Node.js server with database access in PureScript.
It should return a username from a database on http://localhost:8080/user.
I have used purescript-express and purescirpt-mysql. (express-example),(mysql-example)

Calling the server with:

runToDoServer :: Effect Unit
runToDoServer = do
  conn <- liftEffect $ createConnection connectionInfo
  state <- initState
  port <- (parseInt <<< fromMaybe "8080") <$> lookupEnv "PORT"
  _ <-
    listenHttp (appSetup state conn) port \_ ->
      log $ "Listening on " <> show port
  liftEffect $ closeConnection conn

appSetup :: AppState -> Connection -> App
appSetup state conn = do
  liftEffect $ log "Setting up"
  setProp "json spaces" 4.0
  use (logger state)
  get "/user" (getUser conn)
  useOnError (errorHandler state)

getFirstUser :: MySQL.Connection -> Aff (Array { nickname :: String })
getFirstUser conn = MySQL.query_ "SELECT nickname FROM users LIMIT 1" conn

processRows :: Array ({ nickname :: String }) -> Handler
processRows rows = case head rows of
  Just user -> sendJson { status: user.nickname }
  Nothing -> nextThrow $ error "No User"

getUser :: Connection -> Handler
getUser conn = do
  fiberRows <- launchAff $ getFirstUser conn
  rows <- joinFiber fiberRows
  processRows rows 
  -- Error:   Could not match type HandlerM with type  Aff

If someone has a working example or knows how to solve this, I would be glad to hear.

Ok, using Pool instead of connection does it:

createPool' :: Effect Pool
createPool' = createPool connInfo defaultPoolInfo
  where
  connInfo =
    defaultConnectionInfo
      { host = "localhost"
      }

getFirstUser :: Pool -> Aff (Array { nickname :: String })
getFirstUser pool = flip withPool pool \conn -> query_ "SELECT nickname FROM users LIMIT 1" conn

getUser :: Pool -> Handler
getUser pool = do
  rows <- liftAff $ getFirstUser pool
  processRows rows

runToDoServer :: Effect Server
runToDoServer = do
  conn <- liftEffect createPool'
  state <- initState
  port <- (parseInt <<< fromMaybe "8080") <$> lookupEnv "PORT"
  listenHttp (appSetup state conn) port \_ ->
    log $ "Listening on " <> show port

withPool releases the connection as it says in the source.