Simple way to make complex HTTP servers with python
Project description
Project Description
HTTP-PyServer is a simple, and extremely light-weight solution to create powerful projects relying on the web with the fewest lines of code. It uses python built-in packages to host server's and then handle http requests, as well as responses. It's extremely customizable, and allows you do to almost everything you might want.
HTTP-PyServer is also very flexible on your project layout. It ensures security by allowing you to specify which files to send, and to where. HTTP-PyServer allows you to do everything you need whilst keeping hands relaxed with as few lines of code as possible.
Installing
Install HTTP-PyServer using pip from the command line.
python -m pip install HTTP-PyServer
Simple Example
# Saved as "main.py"
import server
app = server.Server()
@app.route('/')
def _(request):
return 'Hello, world!'
with app:
app.wait('Press Enter to continue...')
$ python main.py
Press Enter to continue...
Contributing
Look on github, and create a fork of HTTP-PyServer. Submit, pull requests, and any features will be looked at, and potentially implemented.
Used Packages
Although, no external packages were used, the following packages were imported. All packages are native in Python 3.11.2
. Not tested on any other versions, however it should work.
threading
socket
typing
logging
pathlib
re
time
json
urllib
mimetypes
enum
ssl
secrets
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
Built Distribution
File details
Details for the file HTTP-PyServer-0.1.4.3.2.tar.gz
.
File metadata
- Download URL: HTTP-PyServer-0.1.4.3.2.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10ae04b1799954d04714a58eac2ba30f58cf7e9079cd70e970d48ee8882d8628 |
|
MD5 | 4a05c8cd4220be95fffb1ba794a4da75 |
|
BLAKE2b-256 | c639926535918071076203f6cd853ecef8d89e3bf94f4811b91afca3fcf9db4e |
File details
Details for the file HTTP_PyServer-0.1.4.3.2-py3-none-any.whl
.
File metadata
- Download URL: HTTP_PyServer-0.1.4.3.2-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cf2d2f1146c4009f4c0886710ac1d423651c9667d31f3296c7696391d0a98ef |
|
MD5 | 9392cb4cf1ed30cf2b5c89353fc9ed30 |
|
BLAKE2b-256 | 7b6e3916a8575dc574cd5ba6bb34411872a7e0b9776824f2a70aa9cce91476cf |