Update body parsing and file streaming exemples#1128
Update body parsing and file streaming exemples#1128RatchetS2 wants to merge 1 commit intouNetworking:masterfrom
Conversation
|
Don't remove examples. Esp. not when the substitute is slower: It might look as "unoptimized code" to you, but it's not. Sure, there is a missing call to cork(), so you could add that call. |
|
I updated the body parsing example, you should get better performance. About changes: |
We don't optimize for size, we optimize for speed. And examples should show the best way for speed. If you want to optimize for size, use Express. |
I see, but it's not really newcomer friendly, the body parsing example was the one that makes me doubt to use uWS.js, it makes it look so hard just to parse the body. If performance is realy the main point and as parsing request body is an important feature, we could add a parseBody or onParsedBody function directly on the HttpResponse c++ wrapper. |
|
I have updated the examples, again, they are now even simpler. |
As a newcomer, these examples were difficult to understand and adapt to my needs.
There were missing cork() calls and unoptimized code.
So I share these complete examples that are simpler and more understandable.