Navigation Menu

Skip to content

Commit

Permalink
Follow API change in express-droonga
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 7, 2014
1 parent 9ac3040 commit e9f8ce2
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions bin/droonga-http-server
Expand Up @@ -44,13 +44,27 @@ application.configure(function() {
store: sessionStore
}));
application.use(responseTime());
if (droonga.cache && options.cacheSize > 0) {
application.use(droonga.cache({
size: options.cacheSize,
rules: [
{ regex: /./ }
]
}));
if (options.cacheSize > 0) {
var cacheMiddlewareRules = [
{ regex: /./ }
];
if (droonga.Cache) {
var cache = new droonga.Cache({
size: options.cacheSize,
});
application.use("/cache/statistics",
droonga.middleware.cacheStatistics(cache));
application.use(droonga.middleware.cache(cache, {
rules: cacheMiddlewareRules
}));
} else if (droonga.cache) {
// TODO: Remove me when express-droonga 1.0.2 is released and
// droonga-http-server requires express-droonga 1.0.2 or later.
application.use(droonga.cache({
size: options.cacheSize,
rules: cacheMiddlewareRules,
}));
}
}
});

Expand Down

0 comments on commit e9f8ce2

Please sign in to comment.