HACKER Q&A
📣 josephernest

C/C++ web framework with routes (like Node.js, Python Flask)


Node.js, and Python Flask or Bottle micro-frameworks make it possible to create a server with routes like this:

    from bottle import route, run
    @route('/hello')
    def index():
        return 'hello world'
    @route('/news')
    def news():
        ...
    run(port=8080)
What are the most popular solutions like this in C or C++?


  👤 cozzyd Accepted Answer ✓
I've used CrowCpp and httplib. httplib has more flexible routing (using regex), though CrowCpp is overall nicer to use.

edit: here's a link to httplib: https://github.com/yhirose/cpp-httplib (CrowCpp has already been linked by someone else)


👤 _448
Why not use Wt(Https://www.webtoolkit.eu)? It has all the bells and whistles included. Here is the examples page showing what it is capable of: https://www.webtoolkit.eu/widgets

The other option is uWs(https://github.com/uNetworking/uWebSockets) but then you have to include the missing parts such as templating system and ORM.


👤 tuna_hn
I have used Drogon. It's a very performant one. https://github.com/drogonframework/drogon

👤 melenaboija
I have been using Crow C++. I find it easy to use and pretty straightforward.

https://github.com/ipkn/crow


👤 adarsh_p
We've used this and like it so far: https://github.com/meltwater/served

👤 tomcam

👤 _benj
I once used facil.io and quite enjoyed it!

👤 p0d
Think you are looking for Blazor :-)