Codota Logo For Javascript
apicache
Code IndexAdd Codota 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

  • lodash
    Lodash modular utilities.
  • crypto
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • colors
    get colors in your node.js console
  • async
    Higher-order functions and common patterns for asynchronous code
  • path
  • commander
    the complete solution for node.js command-line programs
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • mongodb
    The official MongoDB driver for Node.js
  • Top plugins for WebStorm
    The challenge is finding the best plugins for JavaScript development on Intellij IDEs. Who wants to sit there and go over hundreds of plugins to pick the best?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJavascript Code Index
Get Codota for your IDE now