code: function (req, res) {
                  var s3 = new AWS.S3(),
                      bucket = req.params.name,
                      location = getLocation(req),
                      params = {
                          Bucket: bucket,
                          Delimiter: req.query.delimiter,
                          Marker: req.query.marker,
                          MaxKeys: req.query.maxKeys || DEFAULT_MAX_KEYS,
                          Prefix: req.query.prefix
                      },
                      handleListObjects = function (err, data) {
                          if (err) {
                              res.status(500).send(err);
                          } else {
                                
                              // Get link for this set
                              data.links = [{
                                  rel: 'self',
                                  href: getOriginalink(req)
                              }];
                              
                              // Map through bucket contents to filter out self reference and add links
                              data.Contents = data.Contents.map(function (content) {
                                  // Add s3g link to reference the resource
                                  content.links = [{
                                      ref: 'self',
                                      href: getS3ObjectLink(req, bucket, content)
                                  }];
                                  
                                  // Filter out any references to the parent file
                                  if (location.origin + location.search !== content.links[0].href) {
                                      return content;
                                  }
                                  
                              }).filter(Boolean);
                              
                              
                              // If this set of objects has a next marker that means there are > 1000 so provide the link to the next set of data
                              if (data.IsTruncated) {
                                  // Get link for next set using next marker if available or the last key in the content set
                                  data.links.push({
                                      rel: 'next',
                                      href: getNextMarkerLink(req, data.NextMarker || data.Contents[data.Contents.length - 1].Key)
                                  });
                              }
                              res.json(data);
                          }
                      };
                  
                  s3.listObjects(params, handleListObjects);
              }
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