docs for storage envs

This commit is contained in:
2021-11-28 17:48:50 +01:00
parent 4daf9db207
commit 5c669bcce9
4 changed files with 73 additions and 17 deletions

View File

@@ -40,7 +40,8 @@ function formatNullableStringOrRegexpArray(values: any) {
}
convict.addParser({ extension: ['yml', 'yaml'], parse: (s) => yaml.load(s, { schema: Schema }) })
const config = convict({
export const config = convict({
// Server
port: {
doc: 'The port to bind.',
@@ -101,11 +102,13 @@ const config = convict({
},
// Local storage
localAssets: {
doc: 'The path to the assets folder',
format: String,
default: './assets',
env: 'LOCAL_ASSETS',
local: {
assets: {
doc: 'The path to the assets folder',
format: String,
default: './assets',
env: 'LOCAL_ASSETS',
},
},
// Minio storage

View File

@@ -22,7 +22,7 @@ export async function init(App: FastifyInstance) {
if (!storage) {
switch (Config.storage) {
case StorageType.Local:
storage = new Local(Config.localAssets)
storage = new Local(Config.local.assets)
break
case StorageType.S3:
storage = new Minio({