feat: add .env config file (POLL_INTERVAL_MS, PORT, LOG_LEVEL)

This commit is contained in:
zlm committed 2026-06-10 09:16:30 +08:00
1 parent 11b79075a5
commit 786c063e4a
6 files changed
+31 -1

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
import 'dotenv/config'
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
import { logger } from './logger.js'
+1 -1
View File
@@ -8,7 +8,7 @@ import { STATION_SIZE, OFFSET,
readDINT, readREAL, readWORD, parseControlWord } from './protocol.js'
const TAG = 'Scanner'
const POLL_INTERVAL_MS = 1000
const POLL_INTERVAL_MS = parseInt(process.env.POLL_INTERVAL_MS || '1000', 10)
let timer: ReturnType<typeof setInterval> | null = null
let plcConfigs: PLCConfig[] = []