How to publish three.js web app

This is a nodejs crud boilerplate I created many years ago to demontrate Continuous Integration and Deployment (CI/CD) plus many other things.

It has a Heroku example where the node app is automatically pushed to heroku. See the heroku section abouit half way down the readme.

It’s not threejs, but it is a minimal nodejs/npm app that you can cherry pick from or use for reference…

In my Heroku projects setting → Deploy tab → “App connected to Github”, it points to my GitHub repository. It is also setup for auto deploy when I push changes to the master branch on my GitHub repo.

In my code repository, the file that matters to Heroku is the app.json

Your package.json should also have a start script in the scripts section that starts your node server.
eg,

  "scripts": {
    "start": "node ./dist/server.js",
    "test": "echo tests"
  }

If you are interested in dockerising your app or using docker-compose with GitLab CI, then you can also find info in there since that was the original purpose of this tutorial.

1 Like