26 lines
606 B
Python
26 lines
606 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
A security shield for protecting a number of small web applications.
|
|
"""
|
|
from aiohttp import web
|
|
import jinja2
|
|
import aiohttp_jinja2
|
|
from aiohttp_jinja2 import render_template
|
|
|
|
import config
|
|
|
|
app = web.Application()
|
|
aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader('templates'))
|
|
|
|
routes = web.RouteTableDef()
|
|
|
|
@routes.get(config.url_prefix + "/", name='index')
|
|
async def index(request):
|
|
"""The index page."""
|
|
return render_template("index.html", request, locals())
|
|
|
|
app.router.add_routes(routes)
|
|
|
|
if __name__ == "__main__":
|
|
web.run_app(app, host='0.0.0.0', port=5400)
|