Giter VIP home page Giter VIP logo

hack_flask_1's Introduction

SOCIAL OPLESK

πŸ΄β€β˜ οΈ HACKS - BACKEND - 1


πŸ“š tutorial de flask - 1 tutorial
πŸ“š tutorial de flask - 2 tutorial
πŸ“š tutorial de flask - 3 tutorial

- NOTA HACER LAS PRÁCTICAS MEDIANTE VISUAL STUDIO CODE  
* Clonar el repositorio https://github.com/SocialOplesk/hack_backend_python_1.git

* Instalar las dependencias:
  pip install -r requirements.txt 

* Ejecutar servidor app.py en terminal: flask run --debug

* Ejecutar test a nivel global en terminal: pytest -v

* Ejecutar test por cada hack en terminal: pytest -v test_server.py::test_hack_1

* Debes tener en ejecuciΓ³n el servidor app.py para ejecutar correctamente el testing  

Hacks Details
H-1 {'payload':'success'}
H-2 {'payload':'success'}
H-3 {'payload':'success'}
H-4 {'payload':'success'}
H-5 {'payload':[]}
H-6 {'payload': {'email':email,'name': name}}
H-7 {'payload': {'email':email,'name':name,'id':id,}}
H-8 {'payload': {'email':email,'name':name,'id':id,}}

πŸ† H-1

CREATE AN ENDPOINT THAT RESPONDS IF THE REQUEST IS OF TYPE "GET"

ENDPOINT:("/users")
METHOD: "GET"
TYPE: JSON

output => {'payload':'success'}

πŸ† H-2

CREATE AN ENDPOINT THAT RESPONDS IF THE REQUEST IS OF TYPE "POST"

ENDPOINT:("/user")
METHOD: "POST"
TYPE: JSON

output => {'payload':'success'}

πŸ† H-3

CREATE AN ENDPOINT THAT RESPONDS IF THE REQUEST IS OF TYPE "DELETE"

ENDPOINT:("/user")
METHOD: "DELETE"
TYPE: JSON

output => {'payload':'success'}

πŸ† H-4

CREATE AN ENDPOINT THAT RESPONDS IF THE REQUEST IS OF TYPE "PUT"

ENDPOINT:("/user")
METHOD: "PUT"
TYPE: JSON

output => {'payload':'success'}

πŸ† H-5

CREATE AN ENDPOINT THAT RESPONDS IF THE REQUEST IS OF TYPE "GET"

ENDPOINT:("/api/v1/users")
METHOD: "GET"
TYPE: JSON

output => {'payload':[]}

πŸ† H-6

CREATE AN ENDPOINT THAT RESPONDS IF THE REQUEST IS OF TYPE "POST"

ENDPOINT:("/api/v1/user")
METHOD: "POST"
TYPE: JSON
INPUT: http://localhost:5000/api/v1/user?[email protected]&name=fooziman

output =>  {
        'payload': {
            'email':email,
            'name':name,
        }
    }

πŸ† H-7

CREATE AN ENDPOINT THAT RESPONDS IF THE REQUEST IS OF TYPE "POST"

ENDPOINT:("/api/v1/user/add")
METHOD: "POST"
TYPE: JSON
INPUT: "request.form.get('key')"

output => {
        'payload': {
            'email':email,
            'name':name,
            'id':id,
        }
    }

πŸ† H-8

CREATE AN ENDPOINT THAT RESPONDS IF THE REQUEST IS OF TYPE "POST"

ENDPOINT:("/api/v1/user/create")
METHOD: "POST"
TYPE: JSON
INPUT: "request.get_json()"

output => {
        'payload': {
            'email':email,
            'name':name,
            'id':id,
        }
    }


hack_flask_1's People

Contributors

socialoplesk avatar frostlord98 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.