evedes
June 27, 2017, 12:12am
1
Hi guys!
It’s my 4th API microservice in Glitch. Today I’ve imported one of my projects from GitHub and it wasn’t running okay. I’ve tested anything and reviewed all the code. Then I’ve noticed that glitch was using port 8120 for process.env.PORT by default. In my last projects it was always using 3000. Is it a bug?!??
Haven’t seen that one, myself at least. Try importing it into a new instance and see if it happens again? Does the repo happen to be public?
Gareth
June 27, 2017, 8:43am
3
Can you let us know the GitHub project if it’s public so we can try and reproduce. Thanks!
evedes
June 27, 2017, 11:56am
4
Hi guys! This is the project I’ve imported and tested again. Don’t know why it listens by default on port 8120.
Can you help me understand that?
Gareth
June 27, 2017, 12:18pm
5
Hah, this one was subtle but my eagle-eyed colleague, Emanuele, spotted the issue.
You were using: process.env.PORT | 8080
, which is a Bitwise OR, 3000 | 8080 = 8120
What you want is the logical OR: process.env.PORT || 8080
evedes
June 27, 2017, 1:21pm
6
Hey folks! Sorry! It was the late night coding ahahahah… I’ve spent 4 hours around this situation! I owe you a beer when u come to Portugal!
Thank you for the quickest support in the world
1 Like