Redwood aims to be a serverless framework. But what if you really want to run it on Heroku?
This guide aims to walk you through each piece required to make it work.
- Add
app.json
,Procfile
,config/nginx.conf.erb
,index.js
yarn workspace api add @redwoodjs/api-server
yarn remove -W @redwoodjs/core && yarn add -W @redwoodjs/core pm2
- Update your root
package.json
with the following scripts:"scripts": { "build": "rw build", "start": "node index.js" },
- Set
apiProxyPath
inredwood.toml
toapiProxyPath = "/api"
Note that you will need to manually add the heroku/nginx
buildpack manually to your app if you are setting this up on an already created Heroku stack.
just a note to say this worked (fantastic!) but I had to manually add the nginx buildpack (as https://github.com/heroku/heroku-buildpack-nginx) since it wasn't being picked up through app.json