Tabnine Logo For Javascript
apicache
Code IndexAdd Tabnine to your IDE (free)

How to use apicache

Best JavaScript code snippets using apicache(Showing top 4 results out of 315)

origin: ivanseidel/Is-Now-Illegal

app.express.get('/:gif.gif', apicache('10 minutes'), (req, res) => {
 const word = req.params.gif || '';
 const filename = word.toUpperCase();
 const uri = `https://storage.googleapis.com/is-now-illegal.appspot.com/gifs/${filename}.gif`;

 res.setHeader('Content-Type', 'image/gif');
 res.setHeader('Access-Control-Allow-Origin', '*');
 res.redirect(301, uri);
});
origin: ivanseidel/Is-Now-Illegal

app.express.get('/:gif', apicache('10 minutes'), (req, res) => {
 const word = req.params.gif || '';
 const filename = word.toUpperCase();

 // const uri = `http://share.isnowillegal.com/${filename}.gif`
 const uri = `https://storage.googleapis.com/is-now-illegal.appspot.com/gifs/${filename}.gif`;

 res.status(200).send(
  template({
   url: uri,
   site: 'IsNowIllegal',
   title: `${word} Is Now Illegal!`,
   gif_url: uri,
   // TODO: this should be dynamic
   gif_preview_url: 'http://share.isnowillegal.com/preview.png',
   description: 'Declare things illegal and trump will sign it.',
   content_type: 'video.other',
   share_url: `http://isnowillegal.com/?${word}`,
  })
 );
});
origin: ivanseidel/Is-Now-Illegal

app.express.get('/:gif.gif', apicache('10 minutes'), (req, res) => {
 const word = req.params.gif || '';
 const filename = word.toUpperCase();
 const uri = `https://storage.googleapis.com/is-now-illegal.appspot.com/gifs/${filename}.gif`;

 res.setHeader('Content-Type', 'image/gif');
 res.setHeader('Access-Control-Allow-Origin', '*');
 res.redirect(301, uri);
});
origin: ivanseidel/Is-Now-Illegal

app.express.get('/:gif', apicache('10 minutes'), (req, res) => {
 const word = req.params.gif || '';
 const filename = word.toUpperCase();

 // const uri = `http://share.isnowillegal.com/${filename}.gif`
 const uri = `https://storage.googleapis.com/is-now-illegal.appspot.com/gifs/${filename}.gif`;

 res.status(200).send(
  template({
   url: uri,
   site: 'IsNowIllegal',
   title: `${word} Is Now Illegal!`,
   gif_url: uri,
   // TODO: this should be dynamic
   gif_preview_url: 'http://share.isnowillegal.com/preview.png',
   description: 'Declare things illegal and trump will sign it.',
   content_type: 'video.other',
   share_url: `http://isnowillegal.com/?${word}`,
  })
 );
});
apicache(npm)

JSDoc

An ultra-simplified API response caching middleware for Express/Node using plain-english durations.

Most used apicache functions

  • apicache

Popular in JavaScript

  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • aws-sdk
    AWS SDK for JavaScript
  • axios
    Promise based HTTP client for the browser and node.js
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • chalk
    Terminal string styling done right
  • redis
    Redis client library
  • moment
    Parse, validate, manipulate, and display dates
  • crypto
  • postcss
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now