Skip to content

Commit 821a3f4

Browse files
author
David Emory
committed
fix(api): Only include port in API requests if specified in config
1 parent fef9629 commit 821a3f4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/actions/api.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const receivedProfileResponse = createAction('PROFILE_RESPONSE')
5454
export const requestProfileResponse = createAction('PROFILE_REQUEST')
5555

5656
function constructPlanQuery (api, query) {
57-
const planEndpoint = `${api.host}:${api.port}${api.path}/plan`
57+
const planEndpoint = `${api.host}${api.port ? ':' + api.port : ''}${api.path}/plan`
5858
const { mode, time, date, maxWalkDistance, optimize } = query
5959
const params = {
6060
arriveBy: query.departArrive === 'ARRIVE',
@@ -111,8 +111,7 @@ export function profileTrip (customOtpQueryBuilder) {
111111
}
112112

113113
function constructProfileQuery (api, query) {
114-
const planEndpoint = `${api.host}:${api.port}${api.path}/plan`
115-
//const planEndpoint = `http://54.157.58.230:5000/api/plan`
114+
const planEndpoint = `${api.host}${api.port ? ':' + api.port : ''}${api.path}/plan`
116115
const { mode, startTime, endTime, date } = query
117116
const params = {
118117
date,

0 commit comments

Comments
 (0)