-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmyServer.sample.js
33 lines (22 loc) · 999 Bytes
/
myServer.sample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var sys = require('sys');
require('./lib/OrionServer');
/*
You can set up a few items here to have ONR do for you.
You need at least a store.
Be aware that OrionStore is a default store and shouldn't be used as the DB calls are not implemented.
Create a custom store by implementing the DB calls, or choose a bundled store, like OrionRiakStore or OrionDBStore.
The same goes for the authModule.
If you add the policyModule, you need to set up the policies first according to the policy samples
*/
var myServer = OrionServer.create({
port: 8080,
store: OrionStore.create(),
authModule: OrionFileAuth.create({ fileName: './myUsers'}),
sessionModule: OrionSession.create({ sessionName: 'OrionServer' }),
policyModule: OrionPolicies.create({ policyFile: './myPolicies'})
});
myServer.start();
//sys.puts("OrionServer: " + sys.inspect(OrionServer));
// start the repl for debugging
//var repl = require('repl');
//repl.start().context.myServer = myServer;