[Groonga-commit] droonga/droonga-http-server at 15c4683 [master] Accept "--document-root" option

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Nov 20 15:34:31 JST 2014


YUKI Hiroshi	2014-11-20 15:34:31 +0900 (Thu, 20 Nov 2014)

  New Revision: 15c468303b1fe645d7d699ced0c11db40c2f5074
  https://github.com/droonga/droonga-http-server/commit/15c468303b1fe645d7d699ced0c11db40c2f5074

  Message:
    Accept "--document-root" option

  Modified files:
    bin/droonga-http-server
    lib/default-configs.js
    lib/server-options.js

  Modified: bin/droonga-http-server (+1 -1)
===================================================================
--- bin/droonga-http-server    2014-11-19 19:33:26 +0900 (f6c2c8a)
+++ bin/droonga-http-server    2014-11-20 15:34:31 +0900 (213a4d3)
@@ -94,7 +94,7 @@ application.use(session({
   store:  sessionStore
 }));
 application.use(responseTime());
-application.use('/', express.static(path.normalize(__dirname + '/../public/groonga-admin')));
+application.use('/', express.static(options.documentRoot));
 if (options.cacheSize > 0) {
   //XXX Activate response cache only for some commands.
   //    In future versions, this restriction should be controlled by

  Modified: lib/default-configs.js (+1 -0)
===================================================================
--- lib/default-configs.js    2014-11-19 19:33:26 +0900 (bb98367)
+++ lib/default-configs.js    2014-11-20 15:34:31 +0900 (8d6a047)
@@ -65,6 +65,7 @@ function defineDefaultConfigs(configs) {
     droonga.API_GROONGA,
     droonga.API_DROONGA
   ]);
+  define(configs, 'document_root', path.normalize(__dirname + '/../public/groonga-admin'));
   define(configs, 'environment', process.env.NODE_ENV || 'development');
 
   // Ignore value of "daemon" option defined in the configuration file,

  Modified: lib/server-options.js (+4 -0)
===================================================================
--- lib/server-options.js    2014-11-19 19:33:26 +0900 (df8932f)
+++ lib/server-options.js    2014-11-20 15:34:31 +0900 (c3b0b84)
@@ -14,6 +14,7 @@ options.pidFile          = defaultConfigs.pid_file
 options.cacheSize        = defaultConfigs.cache_size;
 options.cacheTtlInSeconds = defaultConfigs.cache_ttl_in_seconds;
 options.enableTrustProxy = defaultConfigs.enable_trust_proxy;
+options.documentRoot     = defaultConfigs.document_root;
 options.plugins          = defaultConfigs.plugins;
 options.environment      = defaultConfigs.environment;
 
@@ -91,6 +92,9 @@ function define() {
         '(' + options.enableTrustProxy + ')');
   add('--disable-trust-proxy',
       'Inverted option of --enable-trust-proxy.');
+  add('--document-root <path>',
+      'Path to the document root. ' +
+        '(' + options.documentRoot + ')');
   add('--plugins <plugin1,plugin2,...>',
       'Use specified plugins. ' +
         '(' + options.plugins.join(',') + ')',
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index