UNPKG

2.95 kBMarkdownView Raw
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
8via 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
21The second parameter to the `OrientDBStore` constructor is a callback which will be called once the database connection is established.
22This is mainly used for the tests, however you can use this callback if you want to wait until the store has connected before
23starting your app.
24
25## Example
26
27With 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
50With connect:
51
52 var connect = require('connect');
53 var OrientDBStore = require('connect-orientdb')(connect);
54
55
56## Tests
57
58connect-orientdb uses `mocha`. Install the dependencies with
59
60 npm install -d
61
62then run the tests with
63
64 npm test
65
66The tests expects to find an in memory database called `temp`.
67
68## License
69
70(The MIT License)
71
72Copyright (c) 2012 Federico Fissore <federico^AT_fissore.org>
73
74Permission is hereby granted, free of charge, to any person obtaining
75a copy of this software and associated documentation files (the
76'Software'), to deal in the Software without restriction, including
77without limitation the rights to use, copy, modify, merge, publish,
78distribute, sublicense, and/or sell copies of the Software, and to
79permit persons to whom the Software is furnished to do so, subject to
80the following conditions:
81
82The above copyright notice and this permission notice shall be
83included in all copies or substantial portions of the Software.
84
85THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
86EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
87MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
88IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
89CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
90TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
91SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\No newline at end of file