apstanisic / zmaj

Zmaj is a headless CMS for managing database
https://zmaj.vercel.app
MIT License
5 stars 0 forks source link

Enable full config with env values #35

Closed apstanisic closed 1 year ago

apstanisic commented 1 year ago

Currently, there is no way to configure app this way, and it's complicating publishing this as a docker package

I can simply do something like:

ZMAJ__FILES__GENERATE_COMMON_IMAGE_SIZES=true

Converts to

{ files: { generateCommonImageSizes:true } }

simply by using flat npm package, with __ as separator

Or simply ZMAJ_CONFIG=SOME JSON DATA TO BE INJECTED

apstanisic commented 1 year ago

I do not like the idea of having ugly names for basic things: DATABASE__TYPE vs DB_TYPE.

Maybe it would be easier that every config declares prefix. For example, database can declare DB, and everything starting DB_ will be passed to database, and db can take what it wants

apstanisic commented 1 year ago

Added ability to mount JSON file that will configure it