@@ -8,7 +8,8 @@ export const config = {
|
||||
eventname: process.env.EVENT_NAME || "Please set the event name",
|
||||
currency_symbol: process.env.CURRENCY_SYMBOL || "€",
|
||||
sponsoring_receipt_minimum_amount: process.env.SPONSORING_RECEIPT_MINIMUM_AMOUNT || "10",
|
||||
codeformat: process.env.CODEFORMAT || "qrcode"
|
||||
codeformat: process.env.CODEFORMAT || "qrcode",
|
||||
sponor_logos: getSponsorLogos()
|
||||
}
|
||||
let errors = 0
|
||||
if (typeof config.internal_port !== "number") {
|
||||
@@ -17,4 +18,13 @@ if (typeof config.internal_port !== "number") {
|
||||
if (typeof config.development !== "boolean") {
|
||||
errors++
|
||||
}
|
||||
function getSponsorLogos(): string[] {
|
||||
try {
|
||||
const logos = JSON.parse(process.env.SPONOR_LOGOS);
|
||||
if (!Array.isArray(logos)) { throw new Error("Not an array.") }
|
||||
return logos;
|
||||
} catch (error) {
|
||||
return ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="];
|
||||
}
|
||||
}
|
||||
export let e = errors
|
||||
Reference in New Issue
Block a user