Initial
This commit is contained in:
commit
1110e678a0
|
@ -0,0 +1,5 @@
|
||||||
|
.venv
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
.vscode
|
|
@ -0,0 +1 @@
|
||||||
|
3.6.10
|
|
@ -0,0 +1,3 @@
|
||||||
|
setup:
|
||||||
|
$$(pyenv which python) -m venv .venv
|
||||||
|
. .venv/bin/activate && pip install -r requirements-dev.txt
|
|
@ -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)
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source .venv/bin/activate
|
||||||
|
python app.py
|
|
@ -0,0 +1,4 @@
|
||||||
|
-r requirements.txt
|
||||||
|
|
||||||
|
black
|
||||||
|
flake8
|
|
@ -0,0 +1 @@
|
||||||
|
flask==1.1.1
|
Loading…
Reference in New Issue