Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed Dec 19, 2016
1 parent 7a6e298 commit 0e5a624
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { createHistory } from 'history'
import { useRouterHistory } from 'react-router'

const browserHistory = useRouterHistory(createHistory)({
basename: window['NOMAD_ENDPOINT']
// attempt to remove host+port from NOMAD_ENDPOINT
// long term this could be done by splitting on "/" and take chunk "1..."
basename: window['NOMAD_ENDPOINT'].replace(/^[-.a-zA-Z0-9]+:?[0-9]*/, '')
})

import { Provider } from 'react-redux'
Expand Down

2 comments on commit 0e5a624

@vancluever
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jippi This is here to remove the hostname from the base route. Not too sure if it harms things by being here - ie: if react breaks if the the hostname is present in basename.

@jippi
Copy link
Owner Author

@jippi jippi commented on 0e5a624 Dec 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure :) after som fiddling around I figured that was the purpose :) it seem to work, it just didn't accept - in the hostname before, so it broke hostnames like hashi-ui.something.awesome :)

Please sign in to comment.