Add support for using a port other than 8000

This commit is contained in:
Jesse Crocker
2019-04-16 08:23:21 -06:00
parent de8c687dfb
commit afbaaa66bc
2 changed files with 20 additions and 14 deletions

View File

@@ -89,8 +89,15 @@ export default class App extends React.Component {
autoBind(this);
this.revisionStore = new RevisionStore()
const params = new URLSearchParams(window.location.search.substring(1))
let port = params.get("localport")
if (port == null && (window.location.port != 80 && window.location.port != 443)) {
port = window.location.port
}
this.styleStore = new ApiStyleStore({
onLocalStyleChange: mapStyle => this.onStyleChanged(mapStyle, false)
onLocalStyleChange: mapStyle => this.onStyleChanged(mapStyle, false),
port: port,
host: params.get("localhost")
})