Add configurable manifest-driven race audio system
This commit is contained in:
@@ -13,9 +13,11 @@ const DB_PATH = path.join(DB_DIR, "rc_timing.sqlite");
|
||||
const AMMC_CONFIG_PATH = path.join(DB_DIR, "ammc_config.json");
|
||||
const PID_FILE = process.env.RC_TIMING_PID_FILE || "";
|
||||
const SRC_DIR = path.join(__dirname, "src");
|
||||
const RACE_SOUND_DIR = path.join(__dirname, "rc-race-sound-pack");
|
||||
const WATCHED_FILES = [
|
||||
path.join(__dirname, "index.html"),
|
||||
path.join(__dirname, "public-training.html"),
|
||||
path.join(RACE_SOUND_DIR, "sound_manifest.json"),
|
||||
...fs.readdirSync(SRC_DIR)
|
||||
.filter((fileName) => /\.(?:js|css)$/i.test(fileName))
|
||||
.map((fileName) => path.join(SRC_DIR, fileName)),
|
||||
@@ -324,6 +326,12 @@ app.get("/public-training/:shareToken", (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.use("/race-sounds", express.static(RACE_SOUND_DIR, {
|
||||
setHeaders: (res, filePath) => {
|
||||
res.setHeader("Cache-Control", filePath.endsWith(".wav") ? "public, max-age=86400" : "no-store");
|
||||
},
|
||||
}));
|
||||
|
||||
app.use(
|
||||
"/src",
|
||||
express.static(SRC_DIR, {
|
||||
|
||||
Reference in New Issue
Block a user