Update body parsing and file streaming exemples#1128
Update body parsing and file streaming exemples#1128BV-WebDev 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. |
The body parsing and file streaming examples were difficult to understand and adapt to my needs.
Here I updated them to be simpler and better documented.