Add some files for experimenting with a Flask server
This commit is contained in:
parent
a8327b01f1
commit
54e28c36d4
0
lexipython/__init__.py
Normal file
0
lexipython/__init__.py
Normal file
8
lexipython/server.py
Normal file
8
lexipython/server.py
Normal file
@ -0,0 +1,8 @@
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/')
|
||||
def root():
|
||||
return "yello"
|
||||
|
22
server.py
Normal file
22
server.py
Normal 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__)
|
Loading…
Reference in New Issue
Block a user