From 2cbb0645b07a1eead605874bc97a989b3fc1d89f Mon Sep 17 00:00:00 2001 From: SaloniGoyal Date: Thu, 16 Jun 2016 11:52:24 +0530 Subject: plot generated using plotly.js --- app.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'app.js') diff --git a/app.js b/app.js index 0a72ee5..d9608e8 100644 --- a/app.js +++ b/app.js @@ -1,29 +1,41 @@ var express = require('express'), path = require('path'), - config = require('./config/config.js') + config = require('./config/config.js'), + fs = require('fs'), + os = require('os'), + shelljs = require('shelljs/global'), + PythonShell = require('python-shell') var app = express(); +var scriptPath = path.join(__dirname,'views/script'); +//Set views property app.set('views',path.join(__dirname,'views')); +//set Template engine app.engine('html',require('hogan-express')); +//Set it as View engine app.set('view engine','html'); +//Set Static public folder app.use(express.static(path.join(__dirname,'views'))); +//Set Port to run the app app.set('port',process.env.PORT||4000); //Setting config app.set('host',config.host); //Socket IO +//Create server which listen app var server = require('http').createServer(app); +//Socket.io is invoked by passing server var io = require('socket.io')(server); -var fs = require('fs'); var exec = require('child_process').exec; //Routing -require('./routes/routes.js')(express,app,io,fs,exec); +require('./routes/routes.js')(express,app,io,fs,exec,os,PythonShell,scriptPath); +//Listen server server.listen(app.get('port'),function(){ console.log('eSim Runing on port : '+app.get('port')); }) \ No newline at end of file -- cgit