This commit is contained in:
Felipe Martin 2020-02-28 17:34:59 +01:00
commit 1110e678a0
Signed by: fmartingr
GPG Key ID: 716BC147715E716F
7 changed files with 54 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.venv
__pycache__
*.pyc
.vscode

1
.python-version Normal file
View File

@ -0,0 +1 @@
3.6.10

3
Makefile Normal file
View File

@ -0,0 +1,3 @@
setup:
$$(pyenv which python) -m venv .venv
. .venv/bin/activate && pip install -r requirements-dev.txt

36
app.py Normal file
View File

@ -0,0 +1,36 @@
import os
from flask import Flask, request, Response
app = Flask(__name__)
@app.route("/")
def index():
return f"TODO"
@app.route("/headers")
def headers():
content = "\n".join(
[
"{key}={value}".format(key=key, value=value)
for key, value in request.headers.items()
]
)
return Response(content, content_type="text/plain")
@app.route("/environment")
def environment():
content = "\n".join(
[
"{key}={value}".format(key=key, value=value)
for key, value in os.environ.items()
]
)
return Response(content, content_type="text/plain")
if __name__ == "__main__":
app.run(debug=True)

4
local-run.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
source .venv/bin/activate
python app.py

4
requirements-dev.txt Normal file
View File

@ -0,0 +1,4 @@
-r requirements.txt
black
flake8

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
flask==1.1.1