Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL-Shortener

Minimalistic API serving as a URL Shortener Service

Tech Stack

  • TypeScript
  • Express
  • Prisma
  • SQLite

Endpoint definitions

  • /shorten

Shortens Long URL and returns ShortCode

Method: POST

Headers

Content-Type: application/json

Example Request

 curl -X POST -H 'Content-Type: application/json' -d '{"url": "https://youtube.com"}' localhost:3000/shorten

Response

 {
    "message": "Shortcode created successfully",
    "shortCode": "XYZ12DW"
 }

StatusCode: 201

  • /shorten/:shortCode

Redirects you to long URL

Method: GET

Example Request

 curl localhost:3000/shorten/XYZ12DW

Error Response

 {
    "message": "Shortcode not found",
 }

StatusCode: 404

About

Minimalistic URL Shortener Service

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages