Backkr - A backend framework the web
Created by @Almas-Ali
Table of Contents
Introduction
Try out the examples/ folder to see how to use the framework.
Installation
pip install backkr
Usage
from datetime import datetime
from backkr import (
Backkr,
HTMLResponse
)
app = Backkr()
@app.get('/')
async def index(request):
return HTMLResponse(
'<h1>Hello World, Time: {{ time }}</h1>',
time=datetime.now().strftime("%H:%M:%S")
)
@app.get('/{path}')
async def error_404(request):
path = request.match_info.get('path')
return HTMLResponse(f'''\
<center>
<h1>404 Not Found</h1>
<p>Page /{path} not found</p>
</center>
''')
if __name__ == "__main__":
app.run(
debug=True,
host='127.0.0.1',
port=8000
)
Documentation
LICENSE
Licensed under the MIT LICENSE