Files
Kristjan ESPERANTO df6170c596 refactor: centralize server port resolution (#4198)
I took a look at the last remaining FIXME comment in the code - the one
in `js/app.js` pointing to PR #673. It's from 2017 and was already
flagged as a hotfix back then.

The problem: `MM_PORT` got written into a global `global.mmPort` that
was then read inconsistently across the code - sometimes via the global,
sometimes straight from `process.env`, plus separate logic in
`defaults.js`. Three ways to get the same port.

I pulled this into a single `getServerPort()` helper (`MM_PORT` ->
`config.port` -> `8080`) and switched `app.js`, `defaults.js`,
`server.js`, `electron.js` and both serveronly files over to it. The
global is gone now.

Basically the behavior should be unchanged.
2026-07-08 00:52:17 +02:00
..