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

    • commander
      the complete solution for node.js command-line programs
    • 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.
    • winston
      A logger for just about everything.
    • webpack
      Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
    • body-parser
      Node.js body parsing middleware
    • async
      Higher-order functions and common patterns for asynchronous code
    • qs
      A querystring parser that supports nesting and arrays, with a depth limit
    • minimatch
      a glob matcher in javascript
    • handlebars
      Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
    • Top Vim 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