Andr3Dav1d/url-redirector — reverse-engineered prompt
Reverse engineered prompt
Build me a small self hosted URL shortener and redirect service. I want to save links with a custom slug, then when someone visits that slug like /yt it should send them to the real destination URL.
I also need a simple admin API protected by an X API Key header so I can create short links, list everything that exists, and delete a link by slug. Please store the data in Postgres, make it work nicely with Supabase, include the SQL needed to create the links table, and read settings from env for the database URL, API key, port, and domain.
Make it easy to run locally and also easy to deploy with Docker on a VPS behind Traefik. Keep it minimal, clean, and reliable, with sensible error handling. Add a few example requests so I can test creating a link, listing links, deleting one, and checking the redirect. Look up current docs online if you need to.
Want more depth? Deep Reverse