Navigation Menu

Skip to content

Commit

Permalink
Reduce indentations
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 21, 2014
1 parent d062205 commit 8d24ffb
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions bin/droonga-http-server
Expand Up @@ -41,38 +41,37 @@ var server = http.createServer(application);
var MemoryStore = session.MemoryStore;
var sessionStore = new MemoryStore();


if (options.enableLogging) {
application.use(express.logger());
}
application.use(cookieParser('secret key'));
application.use(session({
secret: 'secret key',
store: sessionStore
}));
application.use(responseTime());
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,
}));
}
if (options.enableLogging) {
application.use(express.logger());
}
application.use(cookieParser('secret key'));
application.use(session({
secret: 'secret key',
store: sessionStore
}));
application.use(responseTime());
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,
}));
}
}

application.droonga({
prefix: '',
Expand Down

0 comments on commit 8d24ffb

Please sign in to comment.