Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

358 B
Raw Blame
import { NextResponse } from "next/server";
import { unsplash } from "../utils";

export async function POST(req: Request) {
  const { url } = await req.json();
  if (!url) return new Response("Missing url", { status: 400 });

  const response = await unsplash.photos.trackDownload({
    downloadLocation: url,
  });

  return NextResponse.json(response);
}