Following a course on Nuxt, I have chosen the SSR route when creating this application, separating admin
, client
and server
into their individual files. This is the file structure:
- amazon-clone
- admin
- client
- server
The course material does not cover pushing to git or deploying to Heroku.
I have followed the steps as per Nuxt & Heroku docs, however because each file will have its own package.json
and nuxt.config.js
I am under the impression this will not work. As Heroku will expect a package.json
in the root folder?
What is the best practise for deploying an app to heroku when client
, server
and admin
are seperated?
The repository: https://github.com/TomBell95/amazon-clone
Heroku deployment steps:
- Procfile:
web: npm start
- package.json:
"heroku-postbuild":"npm run build"
"engines": {"node": "14.x"}
heroku buildpacks:set heroku/nodejs
heroku config:set HOST=0.0.0.0
heroku config:set NPM_CONFIG_PRODUCTION=true
I have found similar questions however nothing Nuxt specific (e.g. How to push both the client side and server side project folders together as a one project (api + front end) on github?).