From 54e28c36d499c32f1dc11c0b17decccfca9fc4c6 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Wed, 6 Nov 2019 19:15:36 -0800 Subject: [PATCH] Add some files for experimenting with a Flask server --- lexipython/__init__.py | 0 lexipython/server.py | 8 ++++++++ server.py | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 lexipython/__init__.py create mode 100644 lexipython/server.py create mode 100644 server.py diff --git a/lexipython/__init__.py b/lexipython/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lexipython/server.py b/lexipython/server.py new file mode 100644 index 0000000..d5f98e7 --- /dev/null +++ b/lexipython/server.py @@ -0,0 +1,8 @@ +from flask import Flask + +app = Flask(__name__) + +@app.route('/') +def root(): + return "yello" + diff --git a/server.py b/server.py new file mode 100644 index 0000000..0382e54 --- /dev/null +++ b/server.py @@ -0,0 +1,22 @@ +from lexipython.server import app as server +server.run() + + + +import argparse + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument("--run", action="store_true") + return parser.parse_args() + +def main(): + args = parse_args() + if args.run: + from flaskapp import app + app.run() + +if __name__ == "__main__": + main() +else: + print(__name__)