Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Ensure correct port is used to connect to IDE server. #1314

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
preprocessor. This allows providing visualization with standard library
functionalities or defining utilities that are shared between multiple
visualizations.
- [Ensure correct port is used to connect to IDE server.][1314]. This avoids collisions with other
applications and allows multiple instances of the IDE to run in parallel.

#### EnsoGL (rendering engine)

Expand All @@ -30,7 +32,7 @@ you can find their release notes

[1209]: https://github.com/enso-org/ide/pull/1209
[1291]: https://github.com/enso-org/ide/pull/1291

[1314]: https://github.com/enso-org/ide/pull/1314
<br/>

# Enso 2.0.0-alpha.2 (2020-03-04)
Expand Down
8 changes: 3 additions & 5 deletions src/js/lib/client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ let hideInsteadOfQuit = false

let server = null
let mainWindow = null
let origin = null

async function main() {
runBackend()
Expand All @@ -372,6 +373,8 @@ async function main() {
serverCfg.dir = root
serverCfg.fallback = '/assets/index.html'
server = await Server.create(serverCfg)
const port = server.port
origin = `http://localhost:${port}`
MichaelMauderer marked this conversation as resolved.
Show resolved Hide resolved
}
mainWindow = createWindow()
mainWindow.on("close", (evt) => {
Expand All @@ -382,11 +385,6 @@ async function main() {
})
}

let port = Server.DEFAULT_PORT
if (server) { port = server.port }
else if (args.port) { port = args.port }
let origin = `http://localhost:${port}`

function urlParamsFromObject(obj) {
let params = []
for (let key in obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/lib/common/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as portfinder from 'portfinder'
// === Port ===
// ============

export const DEFAULT_PORT = 8080
const DEFAULT_PORT = 8080

async function findPort(cfg) {
if (!cfg.port) {
Expand Down