microstudio icon indicating copy to clipboard operation
microstudio copied to clipboard

Feature/prepare for heroku

Open FeniXb3 opened this issue 4 years ago • 0 comments

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.

FeniXb3 avatar Jul 18 '21 19:07 FeniXb3