Create a url shortener API
Create a url shortener API
This project is a basic URL shortening API built using the technology of your choice. It enables users to generate short URLs for long links, track the number of clicks on each short URL, and provides redirection to the original URL.
This project provides a foundational URL shortener service with the essential features and flexibility for potential expansion.
No submissions yet, start by making your first submission
This project is a basic URL shortening API built using the technology of your choice. It enables users to generate short URLs for long links, track the number of clicks on each short URL, and provides redirection to the original URL.
http://localhost
or a production URL).3033
if not specified).POST /shorten
url
(string, required): The long URL to be shortened.201 Created
400 Bad Request
GET /:shortId
shortId
(string, required): The unique ID associated with the shortened URL.302 Found
: Redirects to the original URL.404 Not Found
: Returned if the short ID does not exist.GET /:shortId/stats
shortId
(string, required): The unique ID associated with the shortened URL.200 OK
404 Not Found
The server will run on the specified port or default to 3033
.
.env
FileBASE_URL=http://localhost:3033 PORT=3033