reinstate thumbor with new URL
This commit is contained in:
parent
86440517b1
commit
d13fdc8927
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
@ -87,7 +87,7 @@ var cachedImages = JSON.parse(fs.readFileSync(cacheFile))
|
||||||
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, "constants.json")))
|
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, "constants.json")))
|
||||||
var activityImages = constants.activityImages
|
var activityImages = constants.activityImages
|
||||||
|
|
||||||
var thumborURL = "https://thumbor.violets-purgatory.dev/unsafe/"
|
var thumborURL = "https://thumbor-production-0e82.up.railway.app/"
|
||||||
var imgExtension = "png"
|
var imgExtension = "png"
|
||||||
var thumborArgs = `filters:format(${imgExtension})/`
|
var thumborArgs = `filters:format(${imgExtension})/`
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ function socketeer() {
|
||||||
var fp = path.join(imgCache, fn)
|
var fp = path.join(imgCache, fn)
|
||||||
|
|
||||||
if (!cachedImages.imgs[url]) {
|
if (!cachedImages.imgs[url]) {
|
||||||
const response = await (await fetch(url)).arrayBuffer()
|
const response = await (await fetch(thumborURL + imgRes + thumborArgs + url)).arrayBuffer()
|
||||||
|
|
||||||
fs.writeFileSync(fp, Buffer.from(response))
|
fs.writeFileSync(fp, Buffer.from(response))
|
||||||
cachedImages.imgs[url] = {
|
cachedImages.imgs[url] = {
|
||||||
|
|
Loading…
Reference in a new issue