Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Create server configuration file for test purposes
Browse files Browse the repository at this point in the history
The server configuration files contains the port 8080, since
semaphoreci does not allow to run a server in port 80.

Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com>
  • Loading branch information
Bruno Bottazzini committed Apr 6, 2016
1 parent 29f401d commit 540e00f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@
var jConf;
var args = process.argv.slice(2);
var server = process.argv.slice(1)[0];
if (args.length === 0 || server.indexOf("protractor")) {
if (args.length === 0) {
jConf = getConfigurationJson();
} else {
jConf = getConfigurationJson(args[0]);
if (args[0] === 'protractor.config.js') {
jConf = getConfigurationJson('test_case/configuration_test.json');
} else {
jConf = getConfigurationJson(args[0]);
}
}

if (jConf.session_system === true) {
Expand Down Expand Up @@ -79,11 +83,7 @@

app.use('/', routes);

if (server.indexOf("protractor")) {
app.set('port', process.env.PORT || 8080);
} else {
app.set('port', process.env.PORT || jConf.server_port);
}
app.set('port', process.env.PORT || jConf.server_port);

var server = app.listen(app.get('port'), function() {
if (jConf.server_output) {
Expand Down
18 changes: 18 additions & 0 deletions test_case/configuration_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"server_port": 8080,
"server_output": true,
"server_user_home_dir": "/tmp",
"sessions_dir" : "./sessions",
"journal_access": true,
"cheat_sheet_access": true,
"run_fbp_access": true,
"login_system": false,
"image_build": true,
"cheat_sheet_url": "http://solettaproject.github.io/docs/nodetypes",
"journal_refresh_period": 3000,
"fbp_service_status_refresh_period": 1000,
"syntax_check_refresh_period": 1100,
"save_file_period": 5000,
"run_dialog_refresh_period": 1000,
"sessions_system": false
}

0 comments on commit 540e00f

Please sign in to comment.