Guest User

Untitled

a guest
Mar 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. var balance = require('crypto-balances')
  2.  
  3.  
  4. module.exports.balance = (event, context, callback) => {
  5. balance(event.pathParameters.id, function(error, result) {
  6.  
  7. if (result.length === 0) {
  8. return callback(null, {
  9. statusCode: 404
  10. })
  11. }
  12.  
  13. if (error) {
  14. return callback(null, {
  15. statusCode: 500,
  16. error: error
  17. })
  18. }
  19.  
  20. callback(null, {
  21. statusCode: 200,
  22. body: JSON.stringify(result)
  23. });
  24. });
  25. };
Add Comment
Please, Sign In to add comment