Skip to content

Petreon/Flask_RESTAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask_RESTAPI

Creating a Flaks REST API to learn new concepts about it This is a simple API that you can do a full CRUD of name,views and likes for video

Routes for the API

  • GET method, /videos/int:videoid , get the data of video if exists

  • PUT method, /videos/int:videoid , with the json of your video {"name":"example","views":integer,"likes":integer}

  • PATCH method, /videos/int:videoid , with the json of your video {"name":"example","views":integer,"likes":integer} in this method you dont need to pass all parameters it will only changes what you put

  • DELETE method, /videos/int:videoid , delete the video if exists

you can see methods examples in the tests.py file

How to install

  1. First create an venv for the application
  • $ python3 -m venv venv
  1. Clone the application
  1. Install the dependencies
  • $ pip3 install -r requirements.txt
  1. Start the enviroment
  • $ source venv/bin/activate
  1. Start the server
  • $ python3 main.py
    attention: if you want to deploy it, turn off the debug mode

About

Creating a Flaks REST API to learn new concepts about it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages