Original Summary

Hey guys, I made an open-source Express like non blocking HTTP Server library in C++. Starting a new web server is as simple as initiating the app with the desired port (8080 default) and start registering routes.<p>#include &lt;PlusWeb&#x2F;HttpServer.h&gt;<p>int main() { HttpServer app(3000);<p><pre><code> app.GET(&quot;&#x2F;users&#x2F;:id&quot;, [](HttpRequest&amp; req, HttpResponse&amp; res) { res.status(200).send(nlohmann::json{ {&quot;id&quot;, req.params[&quot;id&quot;]}, {&quot;name&quot;, &quot;ada&quot;}, }); }); app.serve([] { std::cout &lt;&lt; &quot;listening on :3000\n&quot;; });</code></pre> }<p>It supports middleware chaining and since it uses tries for storing routes instead of a flat array like Express, the performance gets better as the application scales up<p>For example: At 5 Routes PlusWeb is 4.8x faster than express whereas at 10,000 routes it is 253x faster than express<p>Playground: <a href="https:&#x2F;&#x2F;amsozzer.com&#x2F;projects&#x2F;plusweb" rel="nofollow">https:&#x2F;&#x2F;amsozzer.com&#x2F;projects&#x2F;plusweb</a> It is available to use on <a href="https:&#x2F;&#x2F;github.com&#x2F;Amsozzer1&#x2F;PlusWeb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Amsozzer1&#x2F;PlusWeb</a><p>Some more profiling info available on <a href="https:&#x2F;&#x2F;github.com&#x2F;Amsozzer1&#x2F;PlusWeb&#x2F;blob&#x2F;main&#x2F;PROFILING_REPORT.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Amsozzer1&#x2F;PlusWeb&#x2F;blob&#x2F;main&#x2F;PROFILING_REP...</a><p>Learn more about my mistakes building PlusWeb and how I fixed them on <a href="https:&#x2F;&#x2F;amsozzer.com&#x2F;writing&#x2F;i-could-not-understand-express-so-i-wrote-my-own" rel="nofollow">https:&#x2F;&#x2F;amsozzer.com&#x2F;writing&#x2F;i-could-not-understand-express-...</a>


  • 情报分类:技术学习与提效
  • 分类依据:内容涉及技术、AI、软件工具或工程实践
  • 信息来源:Hacker News 新项目
  • 发布时间:2026/9/23 06:20:41