Skip to content

frectonz/taqsir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taqsir

Taqsir is "shorten" translated to Arabic. According to Google Translate. It's a simple URL shortener API.

Usage

POST to https://taqsir.deno.dev/shorten with a JSON body of:

{
  "url": "https://example.com"
}

the response will be a a shortened URL with a suffix from the adjectives.ts file and the response code will be 201 Created.

{
  "status":"ok",
  "url":"https://taqsir.deno.dev/<random_adjective>"
}

if you want to use a custom suffix, you can do so by adding a suffix key to the JSON body:

{
  "url": "https://example.com",
  "suffix": "dance"
}

If the suffix you requested is already taken, you will get a 409 Conflict response with the following body:

{
  "status":"error",
  "message":"suffix already taken"
}

Technologies used