A URL shortening service with a Postgres database. Shorten URLs, then retrieve them by their short ID. Demonstrates Encore's built-in database management with automatic migrations.
Explore and test endpoints in the Local Dashboard when running locally. When deployed to Encore Cloud, use the Service Catalog to call endpoints and view traces to see how requests flow between services.
No configuration needed. The Postgres database is provisioned automatically when you run encore run.
url.shorten
Shorten a URL. Returns a short ID you can use to retrieve it.
curl -X POST https://aws-ts-url-uz52.staging.encr.app/url \
-H "Content-Type: application/json" \
-d '{"url": "https://encore.dev"}'
url.get
Retrieve the original URL by its short ID.
curl https://aws-ts-url-uz52.staging.encr.app/url/<short_id>