You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
more of a question than an issue here. i'm using convict for a fairly traditional web app. i'd like to make it a bit easier to share config settings between server and client. for example, say you wanted to share validation rules / constraints - something like username max length. today, you basically serialize some subset of your configs (taking care to avoid exposing sensitive settings), output with your markup, then deserialize and use client-side. there are variations to the theme here obviously but the common bits are a) flagging certain settings as safe to send to the client and b) only exposing the safe subset of settings.
the key thing I could see convict helping w/ is the ability to flag certain settings as "public" or safe to share with the client. to this end, i'm imagining extending the existing schema options w/ something like public: true (by default all settings would be considered private / server-side only) and adding a getter to retrieve all "public" settings for easier serialization.
i'm happy to dive in and put together a PR but figured i would check here first. is this something that sounds useful and a good addition to convict? are people already handling this in a nicer way?
thanks for a helpful lib!
-matt
The text was updated successfully, but these errors were encountered:
I understand the scenario you are describing but I don't see it as a common usecase and thus, in my opinion, it shouldn't be implemented in node-convict. If possible this functionality should be implemented in a new module called, for example, node-convict-scoped that would be using node-convict as a dependency.
But if while implementing the new module you notice that small modifications in node-convict would ease your work, please let us know.
When I first started to use node-convict I wanted to contribute new functionalities. But then I realized that those would be of use for just my very-specific usecases. And thus I have made private modules extending node-convict. node-convict should be kept as small as possible cf. http://substack.net/node_aesthetic
hey all -
more of a question than an issue here. i'm using convict for a fairly traditional web app. i'd like to make it a bit easier to share config settings between server and client. for example, say you wanted to share validation rules / constraints - something like username max length. today, you basically serialize some subset of your configs (taking care to avoid exposing sensitive settings), output with your markup, then deserialize and use client-side. there are variations to the theme here obviously but the common bits are a) flagging certain settings as safe to send to the client and b) only exposing the safe subset of settings.
the key thing I could see convict helping w/ is the ability to flag certain settings as "public" or safe to share with the client. to this end, i'm imagining extending the existing schema options w/ something like
public: true
(by default all settings would be considered private / server-side only) and adding a getter to retrieve all "public" settings for easier serialization.i'm happy to dive in and put together a PR but figured i would check here first. is this something that sounds useful and a good addition to convict? are people already handling this in a nicer way?
thanks for a helpful lib!
-matt
The text was updated successfully, but these errors were encountered: