 
 # Helper to cache an endpoint
 fetchAndCache = (key, url, callback) ->
+  console.log 'FETCH', key
   request
     .get(ARTSY_URL + url)
     .set('x-xapp-token': xappToken)

      return next err if err
      if cached
        res.set(cached.headers).send cached.body
        debouncedFetchAndCache key, req.url
      else
        fetchAndCache key, req.url, (err, doc) ->
          return next err if err

        body: sres.body
      db.cache.update { _id: key }, doc, { upsert: true }
      callback? null, doc

# CORS support
app.use cors()

# Cache configured routes
debounced = {}
paths = PATHS.split ','
for path in paths
  app.get path, (req, res, next) ->
