creatcodebuild / hyper2web Goto Github PK
View Code? Open in Web Editor NEWSuper Fast Backend Framework (Educational Purpose)
Super Fast Backend Framework (Educational Purpose)
async def post_record(http, stream, para):
record = json.load(stream.data)
# http.send_error(stream, 200)
Currently an end point function which doesn't call any response methods won't cause exceptions.
This function should cause an exception at the initialization time. That is, if the framework sees this, the app should not even start.
The current implementation of HTTP does IO. I should consider the design of h2
which does not do IO.
My HTTP class should be a wrapper of h2
. The IO part should be done by a specialized IO
class
If url points to a directory, serve the index.html under this directory instead of throwing errors.
After running a set of tests, should report the code coverage of each module.
Should consider coverage.py.
Router is mainly responsible for dispatching requests to corresponding controller action. It utilizes regular expression to match url, parsing URL parameter, request body and header.
https://developers.google.com/web/fundamentals/getting-started/codelabs/your-first-pwapp/
Traceback (most recent call last):
File "/home/wku/anaconda3/lib/python3.6/site-packages/curio/kernel.py", line 826, in _run_coro
trap = current._send(current.next_value)
File "/home/wku/anaconda3/lib/python3.6/site-packages/curio/task.py", line 96, in _task_runner
return await coro
File "/home/wku/Рабочий стол/[project]/[project_work]/mini/speed_test/server_hyper2web/hyper2web-dev/hyper2web/server.py", line 24, in h2_server
sock = create_listening_ssl_socket(address, certfile, keyfile)
File "/home/wku/Рабочий стол/[project]/[project_work]/mini/speed_test/server_hyper2web/hyper2web-dev/hyper2web/sslsocket.py", line 23, in create_listening_ssl_socket
sock.bind(address)
AttributeError: 'coroutine' object has no attribute 'bind'
Add configuration functionality by either using config files, command line parameters or system environment variables.
Config could be a module of its own.
Writing a framework is a big game. Test, test and test.
localhost.crt.pem and/or localhost.key don't exist. HTTP/2 needs certificate files
self.headers = {
':status': '200',
'content-length': '0', # 不知用户是否应该自己计算这个
'server': 'hyper2web'
}
The current implementation doesn't support Python3.5 because dict is unordered in all Pythons prior to 3.6.
But HTTP requires certain order of headers.
A list implementation has order but can not do fast update of headers.
An ordered dict is probably the best choice. However, I can either achieve this by support Python3.6 only or by use the OrderedDict
The concern is what will happen when users do headers.update(some_new_headers)
.
If the old headers and new headers have common fields and these common fields have different orders, which order will the result dict retain?
If the behavior is obviously better in Python3.6, then I will get rid of Python3.5 support.
If not, I will keep support both versions of Python.
Some functionalities are currently in server, since I used the example curio code in h2 as a starting point.
Now I see the needs to separate these code out and put them into the app module.
server is the module which actually talks with http.
app only handles restful end point.
Users built on top of app module. They should never touch server module unless they want to implement their own app module.
In this case, you can use either a micro or full stack application to meet your goal. In addition, a powerful set of HTTP helpers.
Here is example restful API specification: http://guides.rubyonrails.org/routing.html
Write rst docs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.