https://github.com/codetoby/url-shortener
Short URL
https://github.com/codetoby/url-shortener
Last synced: 11 months ago
JSON representation
Short URL
- Host: GitHub
- URL: https://github.com/codetoby/url-shortener
- Owner: codetoby
- Created: 2023-07-11T21:15:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-05T09:07:18.000Z (over 2 years ago)
- Last Synced: 2025-02-17T14:45:24.337Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# URL Shortener
A simple and efficient URL shortener service that allows users to convert long URLs into short and shareable links.
## API Endpoints
- **Shorten a URL**:
- **Endpoint**: `POST /`
- **Body**: `{ "url": "YOUR_LONG_URL_HERE" }`
- **Response**: `{ "id": "SHORT_ID" }`
- **Redirect to Original URL**:
- **Endpoint**: `GET /:shortId`
- **Response**: Redirects to the original long URL.
**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```