Sign inSign up

wadghulegaurav/python-rest-api

By wadghulegaurav

Updated about 3 years ago

http://localhost:5000/

Image
0

101

wadghulegaurav/python-rest-api repository overview

cat app.py

from flask import Flask, jsonify

app = Flask(name)

@app.route('/', methods=['GET']) def welcome(): message = 'Welcome to my Flask API!' return jsonify({'message': message})

@app.route('/v1', methods=['GET']) def get_v1(): data = {'message': 'This is the response for v1 endpoint.'} return jsonify(data)

@app.route('/v2', methods=['GET']) def get_v2(): data = {'message': 'This is the response for v2 endpoint.'} return jsonify(data)

@app.route('/v3', methods=['GET']) def get_v3(): data = {'message': 'This is the response for v3 endpoint.'} return jsonify(data)

if name == 'main': app.run(debug=True)

Tag summary

Content type

Image

Digest

sha256:c1ee1bb79

Size

45.9 MB

Last updated

over 3 years ago

docker pull wadghulegaurav/python-rest-api:0001