Skip to content

Instantly share code, notes, and snippets.

@mdobson
Created June 19, 2014 20:22
Show Gist options
  • Save mdobson/3e43dd06d64b362c9b47 to your computer and use it in GitHub Desktop.
Save mdobson/3e43dd06d64b362c9b47 to your computer and use it in GitHub Desktop.
Caching with Argo + Volos
var argo = require('argo');
var cache = require('volos-cache-memory');
var cacheInstance = cache.create('test', {ttl: 10000});
argo()
.use(cacheInstance.argoMiddleware().cache())
.get('/hello', function(handle) {
handle('request', function(env, next) {
env.response.statusCode = 200;
env.response.body = { "message": "Hello, world" };
next(env);
});
})
.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment