[Groonga-commit] droonga/droonga-http-server at a7f9b19 [master] Add --plugins to change plugins

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Apr 24 16:30:28 JST 2014


Kouhei Sutou	2014-04-24 16:30:28 +0900 (Thu, 24 Apr 2014)

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

  Message:
    Add --plugins to change plugins

  Modified files:
    bin/droonga-http-server

  Modified: bin/droonga-http-server (+15 -5)
===================================================================
--- bin/droonga-http-server    2014-04-24 16:21:23 +0900 (646648b)
+++ bin/droonga-http-server    2014-04-24 16:30:28 +0900 (ee7a4e3)
@@ -17,6 +17,12 @@ intOption = function(newValue, oldValue) {
   return parseInt(newValue);
 }
 
+pluginsOption = function(newValue, oldValue) {
+  return newValue.split(/\s*,\s*/).map(function (plugin) {
+    return require(plugin);
+  });
+}
+
 options
   .version(version)
   .option('--port <port>', 'Port number', intOption, 13000)
@@ -37,6 +43,14 @@ options
           intOption, 100)
   .option('--enable-trust-proxy',
           'Enable "trust proxy" configuration. It is required when you run droonga-http-server behind a reverse proxy.')
+  .option('--plugins <plugin1,plugin2,...>',
+          'Use specified plugins.',
+          pluginsOption,
+          [
+            droonga.API_REST,
+            droonga.API_GROONGA,
+            droonga.API_DROONGA
+          ])
   .parse(process.argv);
 
 var application = express();
@@ -92,11 +106,7 @@ application.droonga({
   receiveHostName: options.receiveHostName,
   hostName: options.droongaEngineHostName,
   port: options.droongaEnginePort,
-  plugins: [
-    droonga.API_REST,
-    droonga.API_GROONGA,
-    droonga.API_DROONGA
-  ]
+  plugins: options.plugins
 });
 
 server.listen(options.port);
-------------- next part --------------
HTML����������������������������...
Download 



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