mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: add POST /api/v1/fetch-urls endpoint for server-side URL import
Accepts { urls: string[] } (1-50), fetches each URL with SSRF protection
via safeFetch, validates as image, saves to workspace, generates WebP
preview for non-browser formats, and returns results with download URLs.
Uses p-queue with concurrency 4 to parallelize fetches.
This commit is contained in:
@@ -23,6 +23,7 @@ import { auditLogRoutes } from "./routes/audit-log.js";
|
||||
import { registerBatchRoutes } from "./routes/batch.js";
|
||||
import { docsRoutes } from "./routes/docs.js";
|
||||
import { registerFeatureRoutes } from "./routes/features.js";
|
||||
import { registerFetchUrlsRoute } from "./routes/fetch-urls.js";
|
||||
import { fileRoutes } from "./routes/files.js";
|
||||
import { registerMemeTemplates } from "./routes/meme-templates.js";
|
||||
import { registerPipelineRoutes } from "./routes/pipeline.js";
|
||||
@@ -165,6 +166,9 @@ await registerToolRoutes(app);
|
||||
// Batch processing routes (must be after tool routes so the registry is populated)
|
||||
await registerBatchRoutes(app);
|
||||
|
||||
// URL fetch routes (server-side image fetching with SSRF protection)
|
||||
await registerFetchUrlsRoute(app);
|
||||
|
||||
// Pipeline routes (must be after tool routes so the registry is populated)
|
||||
await registerPipelineRoutes(app);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user