Thursday, 16 May 2019

Best practices for sharing constants between server and client?

I'm working on a SaaS product with a Node server and React client. I want to share certain constants (e.g., subscription plan IDs, pricing, etc.) between the two projects, so I don't have to update both .env files if something changes.I read one solution would be to create an npm module and just update that as constants change. Would that be the best approach, or do you all have any other suggestions?edit: Found this, which might solve my problem: https://stackoverflow.com/questions/50908913/how-do-i-get-create-react-app-to-compile-code-outside-src

Submitted May 16, 2019 at 08:56PM by Monett1

No comments:

Post a Comment