Last active
April 1, 2022 11:20
-
-
Save anandtripathi5/2f9197689cbad767e1589a3eaf5098ca to your computer and use it in GitHub Desktop.
This is a minimal example of Flask 2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask('__name__') | |
@app.get('/hello') | |
@app.post('/hello') | |
def hello(): | |
return 'This is the awesome hello api request' | |
@app.get('/world') | |
@app.post('/world') | |
def world(): | |
return 'This is the awesome world api request' | |
@app.get('/square/<int:number>') | |
def square(number): | |
return f'Square of given number is {number * number}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment