A simple and efficient URL shortener service that allows users to convert long URLs into short and shareable links.
-
Shorten a URL:
- Endpoint:
POST /
- Body:
{ "url": "YOUR_LONG_URL_HERE" }
- Response:
{ "id": "SHORT_ID" }
- Endpoint:
-
Redirect to Original URL:
- Endpoint:
GET /:shortId
- Response: Redirects to the original long URL.
- Endpoint:
Database Configuration:
- Create a
.env
file in the root directory. - Configure the database settings in the
.env
file. Example:.env.example
Run:
- Make sure to have docker installed
docker-compose up