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

19 points by josephernest ↗ HN
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++?

13 comments

[ 0.72 ms ] story [ 36.4 ms ] thread
I once used facil.io and quite enjoyed it!
thanks!

i just looked, it doesn't seem to have this easy "route('/hello/world')" system, at least not in the main examples, is it included?

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

https://github.com/ipkn/crow

I really liked Crow but unfortunately it seems like the project has been abandoned.
As of today has been doing all what I needed and I found no bugs for my use
If we're talking about this:

https://crowcpp.org

Then the project is pretty active, has multiple commits per week based on its log.

It's been picked up by other maintainers
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)

Think you are looking for Blazor :-)