1 | # connect-orientdb
|
2 |
|
3 | [OrientDB](https://code.google.com/p/orient/) session store for Connect (or Connect based, like Express)
|
4 | Code is a CoffeeScript port to OrientDB from [connect-mongo](https://github.com/kcbanner/connect-mongo)
|
5 |
|
6 | ## Installation
|
7 |
|
8 | via npm:
|
9 |
|
10 | $ npm install connect-orientdb
|
11 |
|
12 | ## Options
|
13 |
|
14 | - `server.host` OrientDB server hostname (optional, default: "localhost")
|
15 | - `server.port` OrientDB server port (optional, default: 2424)
|
16 | - `db.user_name` username (optional, default: "admin")
|
17 | - `db.user_password` password (optional, default: "admin")
|
18 | - `database` Database name (optional, default: "sessions")
|
19 | - `class_name` Class name of the session document (optional, default: "Session")
|
20 |
|
21 | The second parameter to the `OrientDBStore` constructor is a callback which will be called once the database connection is established.
|
22 | This is mainly used for the tests, however you can use this callback if you want to wait until the store has connected before
|
23 | starting your app.
|
24 |
|
25 | ## Example
|
26 |
|
27 | With express:
|
28 |
|
29 | var express = require('express');
|
30 | var OrientDBStore = require('connect-orientdb')(express);
|
31 |
|
32 | var settings = {
|
33 | server: {
|
34 | host: "localhost",
|
35 | port: 2424
|
36 | },
|
37 | db: {
|
38 | user_name: "admin",
|
39 | user_password: "admin"
|
40 | },
|
41 | database: "sessions",
|
42 | class_name: "Session"
|
43 | };
|
44 |
|
45 | app.use(express.session({
|
46 | secret: settings.cookie_secret,
|
47 | store: new OrientDBStore(settings)
|
48 | }));
|
49 |
|
50 | With connect:
|
51 |
|
52 | var connect = require('connect');
|
53 | var OrientDBStore = require('connect-orientdb')(connect);
|
54 |
|
55 |
|
56 | ## Tests
|
57 |
|
58 | connect-orientdb uses `mocha`. Install the dependencies with
|
59 |
|
60 | npm install -d
|
61 |
|
62 | then run the tests with
|
63 |
|
64 | npm test
|
65 |
|
66 | The tests expects to find an in memory database called `temp`.
|
67 |
|
68 | ## License
|
69 |
|
70 | (The MIT License)
|
71 |
|
72 | Copyright (c) 2012 Federico Fissore <federico^AT_fissore.org>
|
73 |
|
74 | Permission is hereby granted, free of charge, to any person obtaining
|
75 | a copy of this software and associated documentation files (the
|
76 | 'Software'), to deal in the Software without restriction, including
|
77 | without limitation the rights to use, copy, modify, merge, publish,
|
78 | distribute, sublicense, and/or sell copies of the Software, and to
|
79 | permit persons to whom the Software is furnished to do so, subject to
|
80 | the following conditions:
|
81 |
|
82 | The above copyright notice and this permission notice shall be
|
83 | included in all copies or substantial portions of the Software.
|
84 |
|
85 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
88 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
89 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
90 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
91 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
\ | No newline at end of file |