Created
March 26, 2020 21:36
-
-
Save aymericbouzy/2dbe9f9c44fc9dcb88e0cc40692c6544 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
db.connect(); | |
const data = db.getData(); | |
return status(200).data(data); | |
} catch(error) { | |
return status(500).error(error); | |
} finally { | |
db.disconnect(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment