tga werke

This commit is contained in:
2020-03-12 11:07:35 +01:00
parent 692c79cefb
commit 49ca01e818
18 changed files with 269 additions and 181 deletions

38
server-a/app.py Normal file
View File

@@ -0,0 +1,38 @@
from flask import Flask
import requests
app = Flask(__name__)
URL = "http://server-check:6000"
@app.errorhandler(404)
def page_not_found(error):
return "beppe's 404 error"
@app.route('/')
def doRequest():
return "it works"
@app.route('/server-a')
def checkThis():
return "server-a is apparently something to worry abt"
@app.route("/server-a/check")
def itAlsoWorks():
return requests.get(URL).json()
@app.route('/check')
def itWorks():
return requests.get(URL).json()
@app.route('/text')
def hope():
return requests.get(URL).text
@app.route('/find/<name>/<port>')
def findServer(name, port):
return requests.get("http://"+name+":"+port)
if __name__ == '__main__':
app.run(debug=True, host="0.0.0.0", port=5000)

10
server-a/dockerfile Normal file
View File

@@ -0,0 +1,10 @@
from python:3.7
copy . /app
workdir /app
run pip install -r requirements.txt
expose 5000
entrypoint [ "python" ]
cmd [ "app.py" ]

View File

@@ -0,0 +1,2 @@
Flask
requests