Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix port restart issue #156

Merged
merged 6 commits into from
Mar 2, 2016
Merged

fix port restart issue #156

merged 6 commits into from
Mar 2, 2016

Conversation

joelanman
Copy link
Contributor

fix port restart issue #148

when a new port is automatically chosen, it's stored in a file: /port.tmp

when the kit restarts on a file change, it looks for the port here first

when the kit is closed (ctrl+c) the port.tmp file is deleted.

@joelanman joelanman changed the title fix port restart issue #148 fix port restart issue Feb 18, 2016
@joelanman
Copy link
Contributor Author

it should check and delete in start.js

@@ -1,6 +1,7 @@
var basicAuth = require('basic-auth'),
prompt = require('prompt'),
portScanner = require('portscanner');
portScanner = require('portscanner'),
fs = require('fs');
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be alphabetical.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mm, it wasn't before either, so lets just focus on the bug fix

@edwardhorsford
Copy link
Contributor

Nice fix! I added some comments. In particular, port is configured using config.js, but this isn't used. Looks like a preexisting bug, but we should fix as part of this PR to I think.

try {
port = Number(fs.readFileSync(__dirname+'/../.port.tmp'));
} catch (e){
port = (process.env.PORT || config.port.tmp);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be config.port, not config.port.tmp.

@edwardhorsford
Copy link
Contributor

LGTM 👍 we can merge as soon as CI passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants