config.json case bugfixe

This commit is contained in:
hojin.jeong 2025-08-25 16:25:44 +09:00
parent 4301e3003f
commit 092df29869
1 changed files with 3 additions and 3 deletions

6
app.js
View File

@ -6,7 +6,7 @@ const NTFY = require('./lib/ntfy')
const Constants = require('./lib/constants')
new class LottoAutomation {
#configFilename = process.env.LOTTO_AUTOMATION_CONFIG_FILENAME ?? 'Config.json'
#configFilename = process.env.LOTTO_AUTOMATION_CONFIG_FILENAME ?? 'config.json'
#configPath = `${process.env.LOTTO_AUTOMATION_CONFIG_DIR ?? __dirname}/${this.#configFilename}`
#config = {}
@ -16,14 +16,14 @@ new class LottoAutomation {
}
#_loadConfig() {
if(!Fs.existsSync(this.#configPath))
throw new Error('Config.json 파일이 존재하지 않습니다.')
throw new Error('config.json 파일이 존재하지 않습니다.')
try {
const configString = Fs.readFileSync(this.#configPath)
this.#config = JSON.parse(configString)
NTFY.Init(this.#config.ntfyUrl, this.#config.ntfyToken)
} catch(e) {
throw new Error('Config.json 파일이 올바르지 않습니다.')
throw new Error('config.json 파일이 올바르지 않습니다.')
}
}
async #_buyLotto() {