Merge pull request #512 from JesseCrocker/local-port

Add support for connecting to a local server on port other than 8000
This commit is contained in:
pathmapper
2019-07-29 17:16:36 +02:00
committed by GitHub
2 changed files with 21 additions and 14 deletions

View File

@@ -91,8 +91,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")
})