From aee29baad01715ab2f5789d28f005447149c180e Mon Sep 17 00:00:00 2001 From: Alfred Melch Date: Fri, 3 Jan 2020 01:25:48 +0100 Subject: [PATCH] Add minimal flask server --- .gitignore | 4 +++- srv/.env | 2 ++ srv/Makefile | 9 +++++++++ srv/ebermergen/__init__.py | 8 ++++++++ srv/requirements.txt | 2 ++ 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 srv/.env create mode 100644 srv/Makefile create mode 100644 srv/ebermergen/__init__.py create mode 100644 srv/requirements.txt diff --git a/.gitignore b/.gitignore index c163077..2e39d47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .vscode/ build/ -node_modules/ \ No newline at end of file +node_modules/ +venv/ +*.pyc \ No newline at end of file diff --git a/srv/.env b/srv/.env new file mode 100644 index 0000000..e6b3f6b --- /dev/null +++ b/srv/.env @@ -0,0 +1,2 @@ +FLASK_APP=ebermergen +FLASK_ENV=development \ No newline at end of file diff --git a/srv/Makefile b/srv/Makefile new file mode 100644 index 0000000..d1858ee --- /dev/null +++ b/srv/Makefile @@ -0,0 +1,9 @@ +venv: + python3 -m venv venv + ./venv/bin/pip install -U pip wheel setuptools + +install: + ./venv/bin/pip install -r requirements.txt + +run: + ./venv/bin/flask run --host 0.0.0.0 \ No newline at end of file diff --git a/srv/ebermergen/__init__.py b/srv/ebermergen/__init__.py new file mode 100644 index 0000000..a11c461 --- /dev/null +++ b/srv/ebermergen/__init__.py @@ -0,0 +1,8 @@ +from flask import Flask + +app = Flask(__name__) + + +@app.route('/') +def index(): + return 'Hello World' diff --git a/srv/requirements.txt b/srv/requirements.txt new file mode 100644 index 0000000..8a2d9ad --- /dev/null +++ b/srv/requirements.txt @@ -0,0 +1,2 @@ +flask==1.1.1 +python-dotenv==0.10.3 \ No newline at end of file