Skip to content

Conversation

@FeniXb3
Copy link
Contributor

@FeniXb3 FeniXb3 commented Jul 18, 2021

Heroku and possibly some other easy-to-host services expect package.json to be in the root folder. Additionally, Heroku expects the app to listen on the port it provides in PORT environment variable.

This pull request includes:

  • adding a new package.json file in the root with start and other scripts calling the corresponding scripts from the actual package.json
  • moving CoffeScript out of dev dependencies, so that Heroku can compile .coffee files before starting the app
  • loading port number from process.env.PORT if possible
  • logging used port number to make it easy to troubleshoot port-related issues

At first I considered moving actually used package.json file from server to the root, but I wasn't sure if there were some important reasons to not have it in the root. It required to update file paths in at least one file, where some node modules were linked as static files on the frontend, as the node_modules folder would be in the root. In the end I thought it will be safer for now to just add a new file instead of using exising one.

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.

1 participant