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

How to use
apicache
function
in
apicache

Best JavaScript code snippets using apicache.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)apicache

Most used apicache functions

    Popular in JavaScript

    • fs-extra
      fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
    • bluebird
      Full featured Promises/A+ implementation with exceptionally good performance
    • glob
      a little globber
    • through2
      A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
    • debug
      small debugging utility
    • moment
      Parse, validate, manipulate, and display dates
    • mocha
      simple, flexible, fun test framework
    • mongodb
      The official MongoDB driver for Node.js
    • http
    • 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