Add skeleton run command

This commit is contained in:
Tim Van Baak 2020-01-02 08:17:58 -08:00
parent eb0ca027a9
commit 81ec200928
3 changed files with 20 additions and 0 deletions

7
amanuensis/app.py Normal file
View File

@ -0,0 +1,7 @@
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def root():
return render_template("admin.html", username="guest")

View File

@ -65,6 +65,13 @@ def command_init(args):
os.mkdir(os.path.join(cfd, "lexicon"))
os.mkdir(os.path.join(cfd, "user"))
@add_argument("-a", "--address", default="127.0.0.1")
@add_argument("-p", "--port", default="5000")
def command_run(args):
"""Runs the default Flask development server"""
from app import app
app.run(host=args.address, port=args.port)
@add_argument("--foo", action="store_true")
def command_dump(args):
"""Dumps the global config or the config for the given lexicon"""

View File

@ -0,0 +1,6 @@
<!doctype html>
<html>
<body>
<h1>Hello, {{username}}</h1>
</body>
</html>