summary refs log tree commit diff
path: root/src/api/Server.ts
diff options
context:
space:
mode:
authorTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-06-22 20:41:43 +0200
committerTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-06-22 20:41:43 +0200
commit37bd06e14271aa3ff69389939f27d7814479234d (patch)
tree321b7afeacc78dcd1543cafcc5c2c8b6099e06fd /src/api/Server.ts
parentBan API compat & Bulk Ban endpoint (#1120) (diff)
downloadserver-ts-37bd06e14271aa3ff69389939f27d7814479234d.tar.xz
Add local image proxy using sharp/jimp pkgs
Diffstat (limited to 'src/api/Server.ts')
-rw-r--r--src/api/Server.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts

index 472ab1d6..0f5df490 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts
@@ -34,7 +34,7 @@ import "missing-native-js-functions"; import morgan from "morgan"; import path from "path"; import { red } from "picocolors"; -import { Authentication, CORS } from "./middlewares/"; +import { Authentication, CORS, ImageProxy } from "./middlewares/"; import { BodyParser } from "./middlewares/BodyParser"; import { ErrorHandler } from "./middlewares/ErrorHandler"; import { initRateLimits } from "./middlewares/RateLimit"; @@ -137,6 +137,8 @@ export class SpacebarServer extends Server { app.use("/api/v9", api); app.use("/api", api); // allow unversioned requests + app.use("/imageproxy/:hash/:size/:url", ImageProxy); + app.get("/", (req, res) => res.sendFile(path.join(PUBLIC_ASSETS_FOLDER, "index.html")), );