Deploy swagger editor on Heroku

475 views
Skip to first unread message

Youssef Tourki

unread,
Nov 19, 2015, 4:21:06 PM11/19/15
to Swagger
Hi ! 
We are trying to use swagger to work on our API  and collaborate as a team, 
I cloned the git repo of swagger-editor. Locally, every thing works great when i execute "npm start". 
But when i push the repo to a Heroku app, "npm start" get executed, but when trying to access to the heroku app, i have a timeout and an error in the heroku logs : 


2015-11-19T15:45:00.747101+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-11-19T15:45:00.747101+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-11-19T15:45:01.424258+00:00 heroku[web.1]: Process exited with status 137
2015-11-19T15:45:01.488687+00:00 heroku[web.1]: State changed from starting to crashed

Can anyone please help me with deploying swagger-editor to heroku ? 

Thanks everyone !

wing328

unread,
Nov 19, 2015, 9:31:00 PM11/19/15
to Swagger
The error message mentioned failure binding to port $PORT.

Is $PORT defined? Is there's another server already bind to $PORT?

William

Youssef Tourki於 2015年11月20日星期五 UTC+8上午5時21分06秒寫道:

Youssef Tourki

unread,
Nov 20, 2015, 4:59:38 AM11/20/15
to Swagger
Hi William, thank you for your help, 
actually swagger-editor is a node app, and in heroku there is the  https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html variable that is defined

for example when you execute:  heroku run node -a heroku-app-name  
then in the node console on heroku you enter  process.env.PORT , it gives 48909  ( a random free PORT number ) 
So it's heroku who handles the PORT available to use by the node app
In the swagger-editor code, i searched for the PORT config and i changed any port number with the  process.env.PORT  (that is initialized by Heroku) 

Youssef Tourki

unread,
Nov 20, 2015, 5:02:02 AM11/20/15
to Swagger
sorry for that link, i meant  "process.env.PORT" variable ,    i couldn't edit it , no edit feature in google group 
Reply all
Reply to author
Forward
0 new messages