Skip to content

jeff-chang/url_shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Requirement

pip install flask

Service start

python manage.py

RESTful API

GET SHORT URL

  • URL

    /url

  • Method

    POST

  • DataParams Required

    ori_url=URL

  • Response

    • Success
      {
        "status": 0,
        "code": 200,
        "message": short_url
      }
      
    • Error
      {
        "status": -1,
        "code": 403,
        "message": "incorrect url"
      }
      

REDIRECT SHORT URL

  • URL

    /<short_url>

  • Method

    GET

  • Response

    • Success
    {
      "code": 302,
      "redirect": origin_url,
    } 
    
    • Error
    {
      "code": 404,
      "message": "unknown url",
      "status": -1
    }
    

About

url_shortener

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages