HappyX web framework bindings for Python 🐍
Project description
HappyX
Python Bindings For HappyX Web Framework 🔥
Get Started
Install
You can install HappyX via pypi
:
pip install happyx
Usage
Hello World
from happyx import new_server
app = new_server('127.0.0.1', 5000) # host and port are optional params
@app.get('/')
def home():
return "Hello world!"
app.start()
JSON/HTML/File Responses
from happyx import new_server, JsonResponse, HtmlResponse, FileResponse
app = new_server()
@app.get('/json')
def json_resp():
return JsonResponse(
{'key': 'value', 'arr': [1, 2, 3, 4, 5]},
status_code=200 # also available headers: dict param
)
@app.get('/html')
def html_resp():
return HtmlResponse(
'<h1>HTML Response!</h1>',
status_code=200 # also available headers: dict param
)
@app.get('/file')
def file_resp():
return FileResponse('my_cool_icon.png')
app.start()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
happyx-2.3.0.tar.gz
(1.5 MB
view details)
File details
Details for the file happyx-2.3.0.tar.gz
.
File metadata
- Download URL: happyx-2.3.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d8c04be63fc1fc59130201828c38f6cef131009719fe2a5edc0ee0f82f493ec |
|
MD5 | 18899a4c73cca62905ec57fd73da2eed |
|
BLAKE2b-256 | 713d0218f92506a6cb4e82094dd717e8c9ab29419ccf4a0c22f085515df6bb5b |