code: function (req, res) {
                  var s3 = new AWS.S3(),
                      handleListBuckets = function (err, data) {
                          if (err) {
                              res.status(500).send(err);
                          } else {
                              // Add link
                              data.Buckets.forEach(function (bucket) {
                                  bucket.links = [{
                                      rel: 'self',
                                      href: getBucketLink(req, bucket.Name)
                                  }];
                              });
                              
                              res.json(data.Buckets);
                          }
                      };
                  
                  s3.listBuckets(handleListBuckets);
              }
docs: Set strict routing that /buckets/test/abc is not the same as /buckets/test/abc/ adding the slash at the end denotes creating a folder and not a file