mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 15:13:05 +00:00
Remove fallback URIs, remove endpointClient, expose admin api
This commit is contained in:
1 parent
e981f491b7
commit
13bbf5dbd5
11 files changed
+22
-27
No files matched your search
@@ -40,7 +40,7 @@ router.post("/:channel_id", multer.single("file"), async (req: Request, res: Res
|
||||
const id = Snowflake.generate();
|
||||
const path = `attachments/${channel_id}/${id}/${filename}`;
|
||||
|
||||
const endpoint = Config.get()?.cdn.endpointPublic || "http://localhost:3001";
|
||||
const endpoint = Config.get()?.cdn.endpointPublic;
|
||||
|
||||
await storage.set(path, buffer);
|
||||
let width;
|
||||
|
||||
@@ -62,8 +62,7 @@ router.post(
|
||||
if (ANIMATED_MIME_TYPES.includes(type.mime)) hash = `a_${hash}`; // animated icons have a_ infront of the hash
|
||||
|
||||
const path = `avatars/${user_id}/${hash}`;
|
||||
const endpoint =
|
||||
Config.get().cdn.endpointPublic || "http://localhost:3001";
|
||||
const endpoint = Config.get().cdn.endpointPublic;
|
||||
|
||||
await storage.set(path, buffer);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ router.post("/", multer.single("file"), async (req: Request, res: Response) => {
|
||||
if (ANIMATED_MIME_TYPES.includes(type.mime)) hash = `a_${hash}`; // animated icons have a_ infront of the hash
|
||||
|
||||
const path = `guilds/${guild_id}/users/${user_id}/avatars/${hash}`;
|
||||
const endpoint = Config.get().cdn.endpointPublic || "http://localhost:3001";
|
||||
const endpoint = Config.get().cdn.endpointPublic;
|
||||
|
||||
await storage.set(path, buffer);
|
||||
|
||||
|
||||
@@ -61,8 +61,7 @@ router.post(
|
||||
throw new HTTPError("Invalid file type");
|
||||
|
||||
const path = `role-icons/${role_id}/${hash}.png`;
|
||||
const endpoint =
|
||||
Config.get().cdn.endpointPublic || "http://localhost:3001";
|
||||
const endpoint = Config.get().cdn.endpointPublic;
|
||||
|
||||
await storage.set(path, buffer);
|
||||
|
||||
|
||||
Reference in new issue
Block a user