Python ASGI server
Project description
Xevel
My first attempt at a python ASGI server
Xevel is very much my first attempt at an ASGI server and it is definitely not perfect. I am open to any PRs or issues if you come across any problems.
NOTE: This will only work on UNIX-based systems.
A basic use example of Xevel could look like this:
from xevel import *
web = Xevel(('localhost', 9208)) # you can use tuples for port setups ('localhost', PORT') or unix sockets (provide file location as string)
# ('localhost', 9208) # inet
# '/tmp/test.sock' # unix
router = Router('localhost:9208') # force routers to only accept connections from certain domain/subdomains. can provide 1 as a string or multiple as a list
@router.before_request()
async def breq():
print('before request is running!!!')
@router.after_request()
async def areq(req):
print(f'after request is running!!! endpoint: {req.url}')
@router.route('/test')
async def test_route(req):
req.resp_headers['XD'] = 'lol'
return 'asgi server works no way!!!'
@web.before_serving()
async def before():
print('before serving is running!!!')
@web.after_serving()
async def after():
print('after serving is running!!!')
web.add_router(router)
web.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
Xevel-0.0.3.tar.gz
(1.8 kB
view details)
Built Distribution
Xevel-0.0.3-py3-none-any.whl
(1.7 kB
view details)
File details
Details for the file Xevel-0.0.3.tar.gz
.
File metadata
- Download URL: Xevel-0.0.3.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da17ab2ace2f1912e3ca59bcc95fa67ab4faa31d067fd142823d9b99eae222dd |
|
MD5 | 39a89b7c48119289f3a0c58f4fcd1122 |
|
BLAKE2b-256 | fe143a2c57e7f9e4f6f6b6a7f9d76c2ccabe21b83fa705b98f328faed53eee30 |
File details
Details for the file Xevel-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: Xevel-0.0.3-py3-none-any.whl
- Upload date:
- Size: 1.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cbb29f08808dc46375883c296475646e3f118b8d38ec6eb00d03befef422f30 |
|
MD5 | db936fa63707b3660d8c04c759573dd2 |
|
BLAKE2b-256 | 2ed72c77a0d8bf71793ce8dc2f299c783d36b0bb42ab0be73a5c296e9d473c0a |