api: convert service config to JS and remove it from main config

This commit is contained in:
wukko
2024-08-03 16:27:20 +06:00
parent 3a2504ae87
commit 332eae16b2
8 changed files with 206 additions and 161 deletions

View File

@@ -1,16 +1,6 @@
import UrlPattern from "url-pattern";
import { loadJSON } from "./misc/load-from-fs.js";
const packageJson = loadJSON("./package.json");
const servicesConfigJson = loadJSON("./src/processing/service-config.json");
Object.values(servicesConfigJson.config).forEach(service => {
service.patterns = service.patterns.map(
pattern => new UrlPattern(pattern, {
segmentValueCharset: UrlPattern.defaultOptions.segmentValueCharset + '@\\.'
})
)
})
export const
version = packageJson.version,
@@ -26,10 +16,6 @@ export const
gif: ["-vf", "scale=-1:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse", "-loop", "0"]
},
services = servicesConfigJson.config,
hlsExceptions = servicesConfigJson.hlsExceptions,
audioIgnore = servicesConfigJson.audioIgnore,
env = {
apiURL: process.env.API_URL || '',
apiPort: process.env.API_PORT || 9000,