X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fskyquake.js;h=2396e1a1768073aa21730d5be12f774755a0698c;hb=78dbf3c771c78bcfac95dcb37d063b4d7b56d299;hp=3fd904dbf582aae374f4ea1f88a64aae10f4abbf;hpb=9ba0c5e5f242e6e5be9af960f49fc9765b8eb0ed;p=osm%2FUI.git diff --git a/skyquake/skyquake.js b/skyquake/skyquake.js index 3fd904dbf..2396e1a17 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()); @@ -137,6 +140,7 @@ if (cluster.isMaster && clusteredLaunch) { 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 @@ -158,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 @@ -222,6 +235,9 @@ if (cluster.isMaster && clusteredLaunch) { //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'); // });