X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fskyquake.js;h=60193574243fffaff6c8d797e0336f3ae5e02a4e;hb=80097691f3ed0adb4406906ef619c1042c2219ea;hp=41ac03bed744474c31a62489ea938e729225488c;hpb=ba19ffdfd442c7ebe66f482b90f6bc65a0e9b8be;p=osm%2FUI.git diff --git a/skyquake/skyquake.js b/skyquake/skyquake.js index 41ac03bed..601935742 100644 --- a/skyquake/skyquake.js +++ b/skyquake/skyquake.js @@ -105,9 +105,12 @@ if (cluster.isMaster && clusteredLaunch) { var app = express(); + app.set('views', __dirname + '/framework/core/views'); + app.engine('html', require('ejs').renderFile); + app.use(session({ secret: 'ritio rocks', - resave: true, + resave: false, saveUninitialized: true })); app.use(bodyParser.json()); @@ -136,6 +139,8 @@ if (cluster.isMaster && clusteredLaunch) { var configuration_routes = require('./framework/core/modules/routes/configuration'); var configurationAPI = require('./framework/core/modules/api/configuration'); var userManagement_routes = require('./framework/core/modules/routes/userManagement'); + var projectManagement_routes = require('./framework/core/modules/routes/projectManagement'); + var session_routes = require('./framework/core/modules/routes/sessions'); /** * Processing when a plugin is added or modified * @param {string} plugin_name - Name of the plugin @@ -157,6 +162,15 @@ if (cluster.isMaster && clusteredLaunch) { } + /** + * Serve jquery + */ + app.use('/jquery', express.static('./node_modules/jquery/dist/jquery.min.js')); + /** + * Serve images + */ + app.use('/img', express.static('./framework/style/img')); + /** * Start listening on a port * @param {string} port - Port to listen on @@ -218,6 +232,12 @@ if (cluster.isMaster && clusteredLaunch) { //Configure user management route(s) app.use(userManagement_routes); + //Configure project management route(s) + app.use(projectManagement_routes); + + //Configure session route(s) + app.use(session_routes); + // app.get('/testme', function(req, res) { // res.sendFile(__dirname + '/index.html'); // }); @@ -252,6 +272,13 @@ if (cluster.isMaster && clusteredLaunch) { app.get('/multiplex-client', function(req, res) { res.sendFile(__dirname + '/node_modules/websocket-multiplex/multiplex_client.js'); }); + + // handle requests for gzip'd files + app.get('*gzip*', function (req, res, next) { + res.set('Content-Encoding', 'gzip'); + next(); + }); + } /**