http://localhost:5000/
101
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)
Content type
Image
Digest
sha256:c1ee1bb79…
Size
45.9 MB
Last updated
over 3 years ago
docker pull wadghulegaurav/python-rest-api:0001