1
0
mirror of https://github.com/osmarks/meme-search-engine.git synced 2026-03-11 16:19:43 +00:00

add image proxy option

This commit is contained in:
osmarks
2026-03-09 18:57:40 +00:00
parent 00afb01e7a
commit 5ae69a0ffc

View File

@@ -1,7 +1,13 @@
import * as config from "../../frontend_config.json"
import { writable, get } from "svelte/store"
export const getURL = x => config.image_path + x[1]
export const getURL = x => {
let rawPath = config.image_path + x[1]
for (const [proxyFrom, proxyTo] of Object.entries(config.proxy ?? {}))
if (rawPath.startsWith(proxyFrom))
return proxyTo + rawPath
return rawPath
}
export const hardConfig = config