-
Notifications
You must be signed in to change notification settings - Fork 279
Expand file tree
/
Copy pathexpress.js
More file actions
33 lines (26 loc) · 765 Bytes
/
Copy pathexpress.js
File metadata and controls
33 lines (26 loc) · 765 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
31
32
33
// Entry point for app.js
'use strict';
var ss = require('./lib/socketstream.js'),
express = ss.api.require('express');
module.exports = function() {
var app = ss.http.middleware = express();
app.listen = function() {
ss.ws.listen.apply(ss.ws, arguments);
};
/* TODO
app.socketstream = function( fn(req,stream) )
app.stream = ss.http.stream;
*/
app.stream = ss.http.stream;
if (ss.env === 'development') {
app.set('views', ss.client.dirs.views);
// Showing stack errors
app.set('showStackError', true);
// Disable views cache
app.set('view cache', false);
// Environment dependent middleware
// throws cannot find stack
// ss.api.require('express-debug')(app, {/* settings */});
}
return app;
};