mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
18 lines
393 B
TypeScript
18 lines
393 B
TypeScript
import { config } from "~/config.ts";
|
|
|
|
export type Json =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| null
|
|
| undefined
|
|
| Json[]
|
|
| { [key: string]: Json };
|
|
|
|
export const proxyUrl = (url: URL): URL => {
|
|
const urlAsBase64Url = Buffer.from(url.toString() || "").toString(
|
|
"base64url",
|
|
);
|
|
return new URL(`/media/proxy/${urlAsBase64Url}`, config.http.base_url);
|
|
};
|