-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
30 lines (25 loc) · 846 Bytes
/
app.js
File metadata and controls
30 lines (25 loc) · 846 Bytes
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 config = {
port: 3000,
rethinkdb: {
host: "127.0.0.1",
port: 28015,
db: "jibe"
}
};
var express = require('express'),
app = express(),
server = require('http').createServer(app),
io = require('socket.io').listen(server),
jibe = require('jibe')({config: config});
// serve the static files in jibe-demo first
// this ensures jibe-demo's index.html is used
app.use(express.static(__dirname + '/public', {maxAge:31557600000}));
// serve node_modules from the lib directory
app.use('/lib', express.static(__dirname + '/node_modules', {maxAge:31557600000}));
// initialize jibe, mount jibe router and browser channel
app.use(jibe.router(io));
app.use(jibe.browserChannelMiddleware);
// start server
server.listen (config.port, function () {
console.info ('Server listening at port %d', config.port);
});