Reputation: 923
I'm creating a an app using react as the frontend and strapi as the backend with a mongobd database.
So I have two folders at the root of the app client
and server
Is it possible to deploy both folders like this on heroku.
I have read in another tutorial that
If deploying your backend to a provider that does not persist storage on the server like Heroku, the default Strapi local server upload will not work as your files on the server are automatically wiped periodically.
Just trying to find the best way to deploy this app
Upvotes: 0
Views: 290
Reputation: 96
It just so happens that I just build a project like this. For the frontend I used Gatsby and Strapi for the CMS. I deployed the Strapi app on Heroku (and used a Postgresql database - you can add this as a plugin from the Heroku dashboard, or do the same with MongoDB) and the Gatsby app on Netlify (same thing you can do with a React app).
It's true that by default Heroku wipes your data once a day (I think), but since are connecting your app to Mongo that shouldn't be an issue. Just add the DB variables to the respective fields in your Heroku app's dashboard.
I like to keep the front and backend separate myself, so I would deploy them as separate repos, either on Heroku or anywhere else.
Upvotes: 0