Add some files for experimenting with a Flask server

This commit is contained in:
Tim Van Baak 2019-11-06 19:15:36 -08:00
parent a8327b01f1
commit 54e28c36d4
3 changed files with 30 additions and 0 deletions

0
lexipython/__init__.py Normal file
View File

8
lexipython/server.py Normal file
View File

@ -0,0 +1,8 @@
from flask import Flask
app = Flask(__name__)
@app.route('/')
def root():
return "yello"

22
server.py Normal file
View File

@ -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__)