Hello,
I have created a file in the root directory for Strapi app called (server.js) with the code below. I couldn’t find any documentation that explains how to run the application in development mode through using “forever” process manager.
if I use “start()” it runs as production and I can’t edit the content-types. I need to have the application running with or without the “watch” in dev.
I don’t know if I have to create an env variable or something but it’s still not working. Instead, I’m doing (pm2 start “yarn develop” ) and that works fine but I would like to work with the config file for future work.
Question: Why are you trying to run the development mode continuously?
Why I ask: this isn’t an environment that we generally support, simply because Strapi is designed so that development happens locally (hence why the content-type builder is disabled in other environments)
The sole purpose is to have a shared dev environment accessible for all developers. It’s going to be hard to replicate the data in DB in all local machines. When a developer builds something and pushes code to a repo, it’s hard for other stakeholders to test, add data, etc. This helps everyone to see changes on the fly.
For instance, when a developer creates a collection, another person can add the data. then, both can test the APIs and continue the development.
I’ve removed the gitignore line for the sqlite file and just commit .tmp/data.db to my repo. Not fancy but works wonders to keep data in sync since I’m the only dev but working in different computers. Another solution in the same line could be a common cloud DB for all devs.
Thanks for posting this. This echoes the issue I’m having - I thought we need to run the heroku-hosted strapi in dev mode so that content can be created via the web UI. So I’m new to strapi and built a local instance, then pushed it to host on Heroku. We want a centralized CMS that our content authors can sign into and create content - we definitely don’t want and can’t have our authors pushing changes via github. Forgive me for hijacking this response, but after reading the forum I wasn’t able to find the right doc about deployment strategy. Any response is much appreciated.
Thanks so much for responding in. We’re getting this “autoreload required” error on our heroku environment when I gave out access to a content creator, so that’s why I thought we had to run in ‘dev’ mode.
That means they are trying to modify the models not the content and that will not work in production mode, and 110% won’t work in Heroku at all, period. Even in dev mode it won’t work in Heroku due to their filesystem.