Skip to content

Instantly share code, notes, and snippets.

@kmaher9
Created July 3, 2019 21:31
Show Gist options
  • Save kmaher9/e0cb0a91dbbc5e707c3f636c72766ec5 to your computer and use it in GitHub Desktop.
Save kmaher9/e0cb0a91dbbc5e707c3f636c72766ec5 to your computer and use it in GitHub Desktop.
exports.getFiles = async function (request, response) {
let files = await File.find({})
if (!files) {
return response.status(404).json({
"data": {
"message": "There are no uploaded files"
}
})
}
return response.status(200).json({
"data": {
"files": files
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment