不同域上的外部 API 和临时服务器
我的临时服务器和生产服务器位于不同的服务器和域上。
处理具有依赖于域名的密钥的外部 API 的最佳方式是什么? 这是不好的做法吗?两者应该位于同一服务器上?
My staging and production servers are on different servers and domains.
Which would be the best way to deal with external APIs that have a key that relies on domain names?
Is this bad practice and both should be on the same server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我自己解决这个问题的方法是在数组中针对不同的环境使用不同的键。
在这种情况下,我将尝试用 PHP 解释它,
希望这有帮助......
Well, my own solution to this problem is using different keys in an array for different environments.
In this case i'll try to explain it in PHP
I hope this helps...