How do I tell heroku that my server.js and package.json are inside a folder?
You'll need to add a package.json
to root, even if it's just for running scripts. Detecting a package.json
is how the Node buildpack detects a Node app too, so it's a minimum requirement to run Node on Heroku.
You'll want to add something like this:
"scripts": { "start": "node backend/server.js"}
heroku local
will by default use the npm start
script at root.