Skip to content

s8900830/URL_Shortener_py_flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

短網址

利用 Flask、Redis、MySQL 透過 RestFulAPI 的方式實現建立短網址、刪除、轉址的功能

部屬方式

  1. 直接使用

    port預設為5000

    py ./app.py
  2. Docker Compose

    透過docker-compose.yml的設定

    已經把flask從port 5000轉發到port 80上

    docker compose up

Demo

  1. Create

    curl -X POST -H "Content-type: application/json" -d '{"url":"https://www.facebook.com/","expireAt":"2024-08-30T09:20:41Z"}' 'http://localhost:port/api/v1/urls' image

  2. Redirect

    curl -L -X GET -i http://localhost:port/3Lr6vWrIL9xBblu image

  3. Delete

    curl -X DELETE -i http://localhost:port/api/v1/urls/3Lr6vWrIL9xBblu image

About

URL_Shortener_py_flask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published