Skip to content

Commit

Permalink
osrm: Use the host even for local servers
Browse files Browse the repository at this point in the history
fixes chairemobilite#821

This uses the value set in the mode config's host field even for local
servers. This allows to specify a specific URL on which to join the
server, for example an ipv4 url where 'localhost' would have resolved to
an ipv6 url, or simply a named URL for the local server.
  • Loading branch information
tahini committed Jan 9, 2024
1 parent b073b29 commit 3944be8
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const configureAllOsrmServers = async function (startServers = true): Promise<vo
// Only configure mode that are enabled
if (modeConfig.enabled === true) {
const port = modeConfig.port;
let host = '';
const host = modeConfig.host !== null ? modeConfig.host : '';

if (port === null || port === undefined || port <= 0) {
errorConfiguringMode(routingMode, 'Invalid port number');
Expand All @@ -103,7 +103,6 @@ const configureAllOsrmServers = async function (startServers = true): Promise<vo
}
} else {
console.log('Using external OSRM for mode ' + routingMode);
host = modeConfig.host !== null ? modeConfig.host : '';
}

// Register OSRMMode object
Expand Down

0 comments on commit 3944be8

Please sign in to comment.