Python module for hosting your files, with routing.
Project description
Handle HTTP GET and POST requests in Python.
Installation
pip install PyHostr
Usage
from PyHostr import PyHostr
# Instantiating the server
server = PyHost("localhost", 8080)
# Creating a GET route
server.get(route="/", response_headers={"Content-type": "text/html"},
response="<h2>INDEX PAGE</h2>")
# Creating a POST route
server.post(
route="/post", response_headers={"Content-type": "application/json"}, handler=handler_func)
# Finally, start the server
server.serve()
License
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
PyHostr-0.5.tar.gz
(1.0 kB
view details)
File details
Details for the file PyHostr-0.5.tar.gz.
File metadata
- Download URL: PyHostr-0.5.tar.gz
- Upload date:
- Size: 1.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a86268e9e5dc902d00aa6e0338e857794f8b80b29f6d8548d3306ab4172d2485
|
|
| MD5 |
25b10721d667dc3ce111d3b49dc9554b
|
|
| BLAKE2b-256 |
7925007f30a68f15155ae3ea9557fd4a919deb5d6c06774a90c95cd7b25b0c9d
|