Hey folks! I'm new to my job as the only developer on a project that relies heavily on several external SaaS services, including Stripe, Sanity, and Mailgun, among others. There are about ten integrations total, and the project won't function without them. I believe it's important to be able to run a local development environment without any internet access or reliance on external services, just the code itself. I'm curious about the strategies other developers use for this. I was thinking about creating an abstraction layer around these services that would return mock responses during local development, while still verifying actual integrations on a staging server. I'm not specifically talking about automated testing, but rather getting the frontend and backend up locally. What are the common practices in the industry? I've mainly worked solo, so I'd appreciate hearing everyone's insights!
1 Answer
Totally with you on the abstraction! I like using the inversion of control pattern, where my app interacts with an internal layer that then communicates with the external services. This way, I can easily simulate responses based on the environment, deflects some headaches when you need to switch services later on.
Related Questions
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String