Add basic rendering of webpage.
This commit is contained in:
parent
cef62bd0c6
commit
75c3544b7c
|
@ -11,7 +11,11 @@ from rookeries import database, errors, security
|
||||||
|
|
||||||
|
|
||||||
def make_api_app(import_name, **kwargs):
|
def make_api_app(import_name, **kwargs):
|
||||||
api_app = flask.Flask(import_name, **kwargs)
|
api_app = flask.Flask(
|
||||||
|
import_name=import_name,
|
||||||
|
template_folder='../templates',
|
||||||
|
static_folder='../static',
|
||||||
|
**kwargs)
|
||||||
errors.attach_error_handlers_to_api_app(api_app)
|
errors.attach_error_handlers_to_api_app(api_app)
|
||||||
database.db.init_app(api_app)
|
database.db.init_app(api_app)
|
||||||
database.migrations.init_app(api_app)
|
database.migrations.init_app(api_app)
|
||||||
|
|
|
@ -38,3 +38,8 @@ def app_status():
|
||||||
}
|
}
|
||||||
|
|
||||||
return flask.jsonify(app_status_info)
|
return flask.jsonify(app_status_info)
|
||||||
|
|
||||||
|
|
||||||
|
@rookeries_app.route('/')
|
||||||
|
def render_single_page_app():
|
||||||
|
return flask.render_template('base.html')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""
|
"""
|
||||||
Tasks for running the server and seeing its configuration.
|
Tasks for running the server and seeing its configuration.
|
||||||
|
|
||||||
:copyright: Copyright 2013-2016, Dorian Pula <dorian.pula@amber-penguin-software.ca>
|
:copyright: Copyright 2013-2017, Dorian Pula <dorian.pula@amber-penguin-software.ca>
|
||||||
:license: AGPL v3+
|
:license: AGPL v3+
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -25,6 +25,11 @@ def config(ctx):
|
||||||
|
|
||||||
|
|
||||||
@inv.task
|
@inv.task
|
||||||
|
def prepare_assets(ctx):
|
||||||
|
inv.run('npm run build', echo=True, pty=True)
|
||||||
|
|
||||||
|
|
||||||
|
@inv.task(prepare_assets)
|
||||||
def run(ctx, port=5000):
|
def run(ctx, port=5000):
|
||||||
"""
|
"""
|
||||||
Run the API app in a server.
|
Run the API app in a server.
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<link rel="icon" type="image/icon" href="/static/images/mr-penguin-amber-favicon.ico"/>
|
<link rel="icon" type="image/icon" href="/static/images/mr-penguin-amber-favicon.ico"/>
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
<link rel="stylesheet" type="text/css" media="screen" href="/font-awesome.css"/>
|
<link rel="stylesheet" type="text/css" media="screen" href="/static/css/font-awesome.css"/>
|
||||||
<link rel="stylesheet" type="text/css" media="screen" href="/static/css/rookeries-bundle.css"/>
|
<link rel="stylesheet" type="text/css" media="screen" href="/static/css/rookeries-bundle.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body class="evening">
|
<body class="evening">
|
||||||
|
|
Loading…
Reference in New Issue