Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/creatcodebuild/hyper2web
Super Fast Backend Framework (Educational Purpose)
https://github.com/creatcodebuild/hyper2web
backend corountine framework http2 python web
Last synced: 10 days ago
JSON representation
Super Fast Backend Framework (Educational Purpose)
- Host: GitHub
- URL: https://github.com/creatcodebuild/hyper2web
- Owner: CreatCodeBuild
- Created: 2017-04-24T23:01:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T20:27:39.000Z (almost 2 years ago)
- Last Synced: 2024-10-05T16:48:39.560Z (about 1 month ago)
- Topics: backend, corountine, framework, http2, python, web
- Language: Python
- Homepage:
- Size: 387 KB
- Stars: 27
- Watchers: 5
- Forks: 5
- Open Issues: 13
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
Awesome Lists containing this project
README
=========
Hyper2Web
=========
Super Fast HTTP2 Framework for Progressive Web ApplicationInstallation
############To install Hyper2Web, run this command in your terminal:
.. code-block:: console
$ # due to a known issue, please install Curio manually
$ pip install git+https://github.com/dabeaz/curio.git
$ pip install hyper2webThis is the preferred method to install Hyper2Web, as it will always install the most recent stable release.
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process... _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/Dependency
##########Python3.6
h2
curio
Quick Start
###########Assuming you have a directory structure like::
your project/
--public/
--index.html
--index.js
...
--app.pyYour ``app.py`` looks like
.. code-block:: python
from hyper2web import app
if __name__ == '__main__':
# A basic callback style API is provided
# Function name is up to you
async def post_echo(request, response):
# Send the data received back to the client
await response.send(request.stream.data)app = app.App(port=5000)
app.post('name', post_echo)
app.up()Then run this script
.. code-block:: console
$ python app.py
That's it!
If you just want to serve static files, it's just 2 lines!
.. code-block:: python
from hyper2web import app
app.App(port=5000).up()Docs
####
Documentation is hosted on hyper2web.readthedocs.io_... _hyper2web.readthedocs.io: http://hyper2web.readthedocs.io
Example
#######See the example folders for examples.
Test
####.. code-block:: console
$ python -m unittest discover test
Run all tests under ``test/`` dir.
Misc
####Why did I create this framework?
********************************April 23rd, 2017, Sunday, I woke up and felt bored and decided to create my own HTTP2 web framework.
Since I had little or some prior web knowledge, this would be a super learning and fun project for me.