https://github.com/tuhinpal/url-shorten-api
Serverless URL Shortener API (Nodejs + MongoDB + Vercel)
https://github.com/tuhinpal/url-shorten-api
mongoclient mongodb serverless serverless-functions url-shortener vercel vercel-serverless
Last synced: about 2 months ago
JSON representation
Serverless URL Shortener API (Nodejs + MongoDB + Vercel)
- Host: GitHub
- URL: https://github.com/tuhinpal/url-shorten-api
- Owner: tuhinpal
- License: apache-2.0
- Created: 2020-10-29T04:50:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-11T04:09:28.000Z (over 4 years ago)
- Last Synced: 2025-03-25T19:37:14.337Z (3 months ago)
- Topics: mongoclient, mongodb, serverless, serverless-functions, url-shortener, vercel, vercel-serverless
- Language: JavaScript
- Homepage: https://url-shorten-api.vercel.app/
- Size: 16.6 KB
- Stars: 10
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Url Shorten API
[](https://youtu.be/TmSohwAM6Ss "Watch it on YouTube")### API Endpoints
**1. Create a Shortned Link (Get):**
*Request*```
https://your-app-url.vercel.app/create?u={url}##Ex.
https://url-shorten-api.vercel.app/create?u=https://thetuhin.com
```*Response*
```json
{
"status": true,
"link": "https://url-shorten-api.vercel.app/?i=1603985599nRrMuJ",
"unique_id": "1603985599nRrMuJ",
"timestamp": 1603985599
}
```**2. Get Main URL from Shortened URL (Get):**
*Request*```
https://your-app-url.vercel.app/?i={unique-id}##Ex.
https://url-shorten-api.vercel.app/?i=1603985599nRrMuJ
```*Response*
```json
{
"status": true,
"main_link": "https://thetuhin.com",
"created_at": 1603985599
}
```### Make Your Own
[](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fcachecleanerjeet%2Furl-shorten-api)**Environment Variables**
- **APP_URL**
(Vercel Deployment Link - https://url-shorten-api.vercel.app)
- **DB_URL**
(MongoDB Url)## Star this Repo if you Liked it ⭐⭐⭐
My Website & Social