[Groonga-commit] droonga/droonga-http-server at 1c16d15 [master] Extract codes from express-droonga

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Mar 28 16:07:41 JST 2014


YUKI Hiroshi	2014-03-28 16:07:41 +0900 (Fri, 28 Mar 2014)

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

  Message:
    Extract codes from express-droonga

  Added files:
    LICENSE
    NEWS.md
    application.js
    package.json

  Added: LICENSE (+21 -0) 100644
===================================================================
--- /dev/null
+++ LICENSE    2014-03-28 16:07:41 +0900 (f8a4374)
@@ -0,0 +1,21 @@
+The MIT License.
+
+Copyright (c) 2014 droonga project
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

  Added: NEWS.md (+5 -0) 100644
===================================================================
--- /dev/null
+++ NEWS.md    2014-03-28 16:07:41 +0900 (910678b)
@@ -0,0 +1,5 @@
+# News
+
+## 1.0.1: 2014-03-29 (planned)
+
+The first release!

  Added: application.js (+67 -0) 100755
===================================================================
--- /dev/null
+++ application.js    2014-03-28 16:07:41 +0900 (7023307)
@@ -0,0 +1,67 @@
+var express = require('express'),
+    droonga = require('express-droonga'),
+    responseTime = require('response-time'),
+    http = require('http'),
+    options = require('commander');
+
+var version = require('./package.json').version;
+
+options
+  .version(version)
+  .option('--port <port>', 'Port number', parseInt, 13000)
+  .option('--receive-host-name <name>',
+          'Host name of the protocol adapter. ' +
+            'It must be resolvable by Droonga engine.',
+          '127.0.0.1')
+  .option('--droonga-engine-host-name <name>', 'Host name of Droonga engine',
+          '127.0.0.1')
+  .option('--droonga-engine-port <port>', 'Port number of Droonga engine',
+          parseInt, 24224)
+  .option('--default-dataset <dataset>', 'The default dataset',
+          'Droonga')
+  .option('--enable-logging', 'Enable logging to the standard output')
+  .option('--cache-size <size>', 'The max number of cached requests',
+          parseInt, 100)
+  .parse(process.argv);
+
+var application = express();
+var server = http.createServer(application);
+
+var MemoryStore = express.session.MemoryStore;
+var sessionStore = new MemoryStore();
+application.configure(function() {
+  if (options.enableLogging) {
+    application.use(express.logger());
+  }
+  application.use(express.cookieParser('secret key'));
+  application.use(express.session({
+    secret: 'secret key',
+    store:  sessionStore
+  }));
+  application.use(responseTime());
+  if (options.cacheSize > 0) {
+    application.use(droonga.cache({
+      size: options.cacheSize,
+      rules: [
+        { regex: /./ }
+      ]
+    }));
+  }
+});
+
+application.droonga{
+  prefix: '',
+  defaultDataset: options.defaultDataset,
+  server: server,
+  sessionStore: sessionStore, // this is required to share session information HTTP APIs
+  receiveHostName: options.receiveHostName,
+  hostName: options.droongaEngineHostName,
+  port: options.droongaEnginePort,
+  plugins: [
+    droonga.API_REST,
+    droonga.API_GROONGA,
+    droonga.API_DROONGA
+  ]
+});
+
+server.listen(options.port);

  Added: package.json (+37 -0) 100644
===================================================================
--- /dev/null
+++ package.json    2014-03-28 16:07:41 +0900 (3fe574a)
@@ -0,0 +1,37 @@
+{
+  "name": "droonga-http-server",
+  "description": "An HTTP Protocol Adapter for the Droonga Engine.",
+  "version": "1.0.0",
+  "author": "Droonga project <droonga �� groonga.org>",
+  "contributors": [
+    {
+      "name": "Daijiro MORI",
+      "email": "mori �� groonga.org"
+    },
+    {
+      "name": "YUKI Hiroshi",
+      "email": "piro.outsider.reflex �� gmail.com"
+    }
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/droonga/droonga-http-server.git"
+  },
+  "license": "MIT",
+  "dependencies": {
+    "commander": "*",
+    "express": ">=3.0",
+    "express-droonga": "1.0.0",
+    "response-time": "*"
+  },
+  "devDependencies": {
+    "express-droonga": "git://github.com/droonga/express-droonga.git#master"
+  },
+  "scripts": {
+    "start": "./application.js"
+  },
+  "main": "index",
+  "engines": {
+    "node": ">=0.8"
+  }
+}
-------------- next part --------------
HTML����������������������������...
下載 



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