An open API service indexing awesome lists of open source software.

https://github.com/fujiwarachoki/pyhostr

A hosting library with routing for Python
https://github.com/fujiwarachoki/pyhostr

http python wrapper

Last synced: 9 months ago
JSON representation

A hosting library with routing for Python

Awesome Lists containing this project

README

          

# PyHostr

Handle HTTP GET and POST requests in Python.

## Installation

```bash
pip install PyHostr
```

## Usage

```python
from PyHostr import PyHostr

# Instantiating the server
server = PyHostr("localhost", 8080)

# Creating a GET route
server.get(route="/", response_headers={"Content-type": "text/html"},
response="

INDEX PAGE

")

# Creating a POST route
server.post(
route="/post", response_headers={"Content-type": "application/json"}, handler=handler_func)

# Finally, start the server
server.serve()
```

## License

[MIT Sami Hindi 2022 (c)](LICENSE.txt)