This commit is contained in:
seb
2026-10-07 19:16:42 +02:00
parent 1743cef11c
commit 857963b1c3
20 changed files with 892 additions and 182 deletions

View File

@@ -103,7 +103,9 @@ export function register(app, basePath = '') {
* schema:
* $ref: '#/components/schemas/Error'
*/
app.get(`${basePath}/image/:fullHash`, async (req, res) => {
const imagePaths = [`${basePath}/image/:fullHash`];
if (basePath) imagePaths.push('/image/:fullHash');
app.get(imagePaths, async (req, res) => {
const parsed = parseFullHash(req.params.fullHash);
if (parsed.error) {
return res.status(400).json({ error: parsed.error });
@@ -186,7 +188,9 @@ export function register(app, basePath = '') {
* schema:
* $ref: '#/components/schemas/Error'
*/
app.get(`${basePath}/thumb/:fullHash`, async (req, res) => {
const thumbPaths = [`${basePath}/thumb/:fullHash`];
if (basePath) thumbPaths.push('/thumb/:fullHash');
app.get(thumbPaths, async (req, res) => {
const parsed = parseFullHash(req.params.fullHash);
if (parsed.error) {
return res.status(400).json({ error: parsed.error });