Skip to content

Commit dd6bdbc

Browse files
committed
Remove protocol setting in favor of baseURL.
baseURL needs to be set to use HTTPS anyway in order to generate correct links.
1 parent 84e63c3 commit dd6bdbc

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

bin/ldf-server

+4-6
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ var configDefaults = JSON.parse(fs.readFileSync(path.join(__dirname, '../config/
2020
config = _.defaults(JSON.parse(fs.readFileSync(args[0])), configDefaults),
2121
port = parseInt(args[1], 10) || config.port,
2222
workers = parseInt(args[2], 10) || config.workers,
23+
protocolMatch = (config.baseURL || '').match(/^(\w+):/),
24+
protocol = config.protocol = protocolMatch ? protocolMatch[1] : 'http',
2325
constructors = {};
2426

25-
// Setup protocol
26-
var protocolBaseUrl = config.baseURL.match(/^(.*?):\/\/.*/);
27-
config.protocol = protocolBaseUrl ? protocolBaseUrl[1] : config.protocol;
28-
2927
// Start up a cluster master
3028
if (cluster.isMaster) {
3129
// Create workers
32-
console.log('Master %d running on %s://localhost:%d/.', process.pid, config.protocol, port);
30+
console.log('Master %d running on %s://localhost:%d/.', process.pid, protocol, port);
3331
for (var i = 0; i < workers; i++)
3432
cluster.fork();
3533

@@ -174,7 +172,7 @@ else {
174172
function startWhenReady() {
175173
if (!--pending) {
176174
server.listen(port);
177-
console.log('Worker %d running on %s://localhost:%d/.', process.pid, config.protocol, port);
175+
console.log('Worker %d running on %s://localhost:%d/.', process.pid, protocol, port);
178176
}
179177
}
180178

config/config-defaults.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "Linked Data Fragments server",
33
"baseURL": "/",
4-
"protocol": "http",
54

65
"port": 3000,
76
"workers": 1,

0 commit comments

Comments
 (0)