src en submodule

This commit is contained in:
2020-03-16 12:15:24 +01:00
parent 577527ebf9
commit 278be2f343
7 changed files with 55 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "infra"]
path = infra
url = https://github.com/beppevanrolleghem/stage-infra

1
infra Submodule

Submodule infra added at e05b588517

38
src/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
src/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" ]

2
src/requirements.txt Normal file
View File

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

1
stage-infra Submodule

Submodule stage-infra added at 7938666913