A backend framework the web
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
backkr-0.0.4.tar.gz
(8.4 kB
view hashes)
Built Distribution
backkr-0.0.4-py3-none-any.whl
(9.3 kB
view hashes)