mirror of
https://github.com/bvanroll/stage-frontend.git
synced 2025-08-29 03:52:45 +00:00
src en submodule
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "infra"]
|
||||
path = infra
|
||||
url = https://github.com/beppevanrolleghem/stage-infra
|
1
infra
Submodule
1
infra
Submodule
Submodule infra added at e05b588517
38
src/app.py
Normal file
38
src/app.py
Normal 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
10
src/dockerfile
Normal 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
2
src/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Flask
|
||||
requests
|
1
stage-infra
Submodule
1
stage-infra
Submodule
Submodule stage-infra added at 7938666913
Reference in New Issue
Block a user