-
Notifications
You must be signed in to change notification settings - Fork 21
/
start.js
32 lines (24 loc) · 1019 Bytes
/
start.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*!
Copyright 2014 Astea
Licensed under the New BSD license. You may not use this file except in
compliance with this License.
You may obtain a copy of the License at
https://github.com/GPII/prefsEditors/LICENSE.txt
*/
// Declare dependencies
/* global require, __dirname */
var kettlePath = process.argv[2] || __dirname + "/node_modules/kettle/node_modules/express/node_modules/connect/";
var host = process.argv[3] || "localhost";
var port = process.argv[4] || 5559;
/*
* Example starting PMT: node start.js ./node_modules/kettle/node_modules/express/node_modules/connect localhost 5559
*/
function startServer(port) {
var connect = require(kettlePath);
var open = require('open');
connect.createServer(connect["static"](__dirname)).listen(port);
console.log("Preferences Management Tool server running...");
console.log("Visit http://"+ host + ":" + port + "/demos/prefsEditor/index.html");
open("http://"+ host + ":" + port + "/demos/prefsEditor/index.html");
}
startServer(port);