如何使用Nestjs配置处理每个模块的不同配置
我想为每个模块具有不同的配置,例如指定的在
这里能够实现这一目标,这是我面临的问题: https://github.com/nestjs/nestjs/config/config/issues/947
I want to have different config for each module like specified here
But I am not able to achieve this, here is the issue that I am facing:
https://github.com/nestjs/config/issues/947
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不完全理解您为什么需要这样的行为,也许有更多信息,我可以给您更详细的输入。但是,从您提供的信息来看,我建议将配置变量保留在全球范围内,并避免使用名称碰撞,这不仅是出于设计目的,而且还用于可读性。
如果您有很多配置变量,则可以始终将它们分为不同的JSON文件并将其从每个模块中加载,但以不同的方式命名它们。
让我知道这是否是您问题的可行解决方案。
I don't fully understand why you need such behaviour, and maybe with more information I could give you a more detailed input. However, from the information you provided, I would suggest to keep the configuration variables globally scoped and avoid name collisions, not only for design purposes but for readability also.
If you have a lot of configuration variables, you can always separate them into different JSON files and load them from each module, but naming them differently.
Let me know if this is a viable solution for your problem.