Hi,
In order to share my experience dealing with some deployment tasks and two existing topics (Music Platform, Using POD server on Heroku) I’m gonna start this thread so hopefully it helps others to put their hands on and avoid wasting 2 days of headaches. Here we go…
First things first, I apologise but to be able to complete these steps a Heroku account is required(*). I’m not familiar with other services, sorry, but I’m happy to get feedback about how to achieve the same goal, publish/expose a SOLID server on the Internet, with a different service (a step by step guide preferably, so it can be reproducible).
These are the commands I’ve run in my machine (Apple M1 Max, macOS Monterey v. 12.5.1, Node.js v18.12.1). They are intended for the Community Server, but in a follow up message I’ll explain the same for Recipes (mashlib).
$ git clone https://github.com/CommunitySolidServer/CommunitySolidServer.git
$ cd CommunitySolidServer
Create a Procfile: a text file in the root directory of your application, to explicitly declare what command should be executed to start your app. The Procfile in should look like this:
web: npm start -p $PORT
If you are using Unix based system:
$ touch Procfile
$ echo "web: npm start -p \$PORT" >> Procfile
$ heroku login
$ heroku create
After this command you’ll get a message similar to
Creating app… done, ⬢ arcane-cove-33793
https://arcane-cove-33793.herokuapp.com/ | https://git.heroku.com/arcane-cove-33793.git
Then you copy the URL and use it to edit the package.json
like this:
Modify package.json
at line:
“start”: "node ./bin/server.js --baseUrl https://arcane-cove-33793.herokuapp.com/ -p "
$ git add .
In case: husky > pre-commit hook failed (add --no-verify to bypass)
$ git commit -am "make it better" --no-verify
$ git push heroku main
(*)Disclaimer:
Starting November 28th, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® will no longer be available. Free Heroku dynos will be converted to Eco dynos and spun down. Any Heroku Scheduler jobs configured to use free dynos will fail. More info: Dyno Types | Heroku Dev Center