Skip to content

Commit

Permalink
Merge pull request #25 from ogavb/dynamicOptionsAlignment2
Browse files Browse the repository at this point in the history
Dynamic options alignment part 2: Dynamic loading of the available services
  • Loading branch information
Roky97 committed Dec 9, 2019
2 parents fd50f8f + 2a8fbb9 commit f34bdf2
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 793 deletions.
9 changes: 8 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var http = require('http');
var forceSSL = require('express-force-ssl');
var webSocket = require('websocket').w3cwebsocket;
var fs = require('fs');
var pug = require('pug');

// System config loading
var properties = require('./config/app-config.json');
Expand Down Expand Up @@ -49,13 +50,19 @@ var io = require('socket.io').listen(enableHTTPS ? secureServer : server);
var pckg = require('./package.json');

app.use(express.static('resources'));
app.set('views', './resources');
app.set('view engine', 'pug');

// Load variables in to the .pug file
app.get('/', function (req, res) {
res.render('index', {"languages": servicesConfig.languages});
});

app.post('/version', function (req, res) { // send the version (and take it in package.json) of the application
res.send('{"version":"' + pckg.version + '"}');
});

io.sockets.on('connection', function (socket) { // Wait for the incoming connection from the browser, the Socket.io client from index.html

print_log('Opened connection')

socket.on('run', function (data) { // Wait for the incoming data with the 'run' event and send data
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "LoIDE",
"version": "2.0.3",
"version": "2.1.0",
"description": "Web-based IDE for Logic Programming",
"main": "app.js",
"scripts": {
Expand Down Expand Up @@ -41,6 +41,7 @@
"express": "^4.17.1",
"express-force-ssl": "^0.3.2",
"helmet": "^3.21.1",
"pug": "^2.0.4",
"socket.io": "^2.3.0",
"websocket": "^1.0.30"
},
Expand Down

0 comments on commit f34bdf2

Please sign in to comment.