Skip to content

Instantly share code, notes, and snippets.

@aymericbouzy
Created March 26, 2020 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aymericbouzy/2dbe9f9c44fc9dcb88e0cc40692c6544 to your computer and use it in GitHub Desktop.
Save aymericbouzy/2dbe9f9c44fc9dcb88e0cc40692c6544 to your computer and use it in GitHub Desktop.
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