Skip to content

vyshnavdas/url-shortener-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

url-shortener-flask

A Url Shortener Api Made With Flask And MongoDB

Variables

Usage

Using Python

import requests

base_url = ''  # Update with your API base URL
  
# Create a shortened URL
long_url = '' #Provide The Long url here
data = {'long_url': long_url}
response = requests.get(base_url + 'shorten', json=data)
  
if response.status_code == 201:
    shortened_url = response.json()['shortened_url']
    print('Shortened URL:', shortened_url)
else:
    print('Error creating shortened URL:', response.json())

Using Browser

http://your-base-url/shorten?long_url=https://the-long-url

About

A Url Shortener Api Made With Flask And MongoDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages