// save as poc.js // // Usage: // npm install express node-fetch // node poc.js // open http://localhost:3000 in browser import express from "express"; import fetch from "node-fetch"; const app = express(); const PORT = 3000; // Serve the PoC HTML app.get("/", (req, res) => { res.type("html").send(` Celtra API Unauthenticated PoC (via Proxy)

Celtra API Test (Unauthenticated, Server-side Proxy)

Result will appear here…
`); }); // Proxy endpoint: browser -> this server -> Celtra API (no CORS in backend) app.get("/celtra/creatives/:id", async (req, res) => { const id = req.params.id; try { const upstream = await fetch(`https://hub.celtra.com/api/creatives/${encodeURIComponent(id)}`); const body = await upstream.text(); res.setHeader( "Content-Type", upstream.headers.get("content-type") || "application/json; charset=utf-8" ); res.status(upstream.status).send(body); } catch (err) { res.status(502).json({ error: "Upstream fetch failed", detail: String(err) }); } }); app.listen(PORT, () => { console.log("PoC running on http://localhost:" + PORT); });