greeter_rest.py 261 Bytes
Newer Older
Schwieger, Jana's avatar
rest  
Schwieger, Jana committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import flask
from flask import request

app = flask.Flask(__name__)

@app.route('/', methods=['GET'])
def home():
    return f"Hello!"

@app.route('/hello/<name>', methods=['GET'])
def hello(name):
    return f"Hello, { name.strip() }!"

app.run(host="0.0.0.0")