Public
Remixed
Starter template with client-side React & Hono server
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

URL Resolver

Paste a list of URLs and get back their final destinations, following all redirects. Handy for un-shortening bit.ly/t.co links, cleaning tracking redirects, or auditing where a batch of links actually leads.

Using the web UI

Open the val's HTTP endpoint, paste one URL per line, and hit Resolve. Each URL is followed through its redirect chain and the table shows:

  • the resolved (final) URL, linked and opened in a new tab
  • the final HTTP status and number of redirect hops
  • any error (invalid URL, timeout, too many redirects, network failure)

There's a Copy resolved list button to grab the cleaned-up URLs as plain text.

Using the API

POST /api/resolve with a JSON body:

{ "urls": ["bit.ly/abc", "https://httpbin.org/redirect/2", "example.com"] }

Returns:

{ "results": [ { "input": "bit.ly/abc", "resolved": "https://example.com/final", "status": 200, "redirected": true, "hops": 2, "ok": true, "error": null } ] }

URLs without a scheme get https:// prepended. Up to 200 URLs per request, resolved with a concurrency of 8. Each request follows at most 15 redirects and times out after 10s per hop.

Architecture

Rendering mermaid diagram...

Files

index.ts                          ← Hono server + /api/resolve route
resolve.ts                        ← redirect-following logic (resolveUrl / resolveMany)
frontend/
  index.html                      ← HTML shell
  index.tsx                       ← React entrypoint
  components/
    App.tsx                       ← input form + state
    ResultsTable.tsx              ← results table + status badges