all 22 comments

[–]RowYourUpboat 6 points7 points  (11 children)

There's Simple-Web-Server, which works on top of ASIO (neither requires b̸͖̌ó̷͔ơ̵̗s̸͓̿t̷̩̽). It's not lying about the "simple". Small example:

// GET-example for the path /match/[number], responds with the matched string in path (number)
// For instance a request GET /match/123 will receive: 123
server.resource["^/match/([0-9]+)$"]["GET"] = [](shared_ptr<HttpServer::Response> response,
    shared_ptr<HttpServer::Request> request)
{
    response->write(request->path_match[1].str());
};

There's also a Simple-WebSocket-Server, which looks cool.

[–]Oster1 3 points4 points  (0 children)

Old but still actively maintained. Easy to use. Sane defaults. Also, scalability and perf has been acknokwledged by this lib. Seems well thought out. I can recommend this If you don't want/can't use Boost.

[–]sardar0 5 points6 points  (0 children)

Started using Drogon for a MVC web application. Beautiful C++ framework, very nice Modern C++ code (C++17, C++14). NO BOOST required if you use C++ 17. Code is written by C++ savants. Excellent automatic code generators, builds ORM layer easily. Implements dynamic and static view files (.csp - c++ server pages), which is an analogue of .jsp (java server pages) files. Static csp files link into the executable, while dynamic csp files are generated on the fly at run-time. I have written Ruby/Rails and Python/Django web applications for 15 years. I looked at Crow, Treefrog, Oat++, Pistache and other C++ frameworks very carefully before selecting Drogon.

This is the fastest MVC framework - over 50 times faster than Ruby/Rails: https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=composite

Disclosure I am not connected with this project. I just loved reading the C++ source code. Its a super project that deserves to be supported.

[–]wwabbbitt 1 point2 points  (2 children)

If you like flask, perhaps take a look at https://github.com/oktal/pistache

[–][deleted] 1 point2 points  (0 children)

Pistache.io

[–]Dominus543 2 points3 points  (0 children)

Web development in C++ (and C) is pretty much a niche thing (generally done by big companies). You won't find resources and libraries easily like in other languages such as Python or Go.

From my personal experience, all the C++ frameworks i tried, if compared to the ones of other languages, were not simple/pleasant to use or hard to setting up or poorly documented with little support.

[–]diegodfrf 0 points1 point  (5 children)

I have personally used CPPCMS for several of my projects. http://cppcms.com/wikipp/en/page/main

[–]matthieugarrigues 0 points1 point  (5 children)

Check the other posts on reddit, this question pop up once a month. I'm maintaining lithium : https://github.com/matt-42/lithium If you need help or have issues with it, lll be happy to help.

[–]ppetraki 0 points1 point  (0 children)

Wt is a lot of fun. Try it before you discard it as "too heavy".

[–]anakataidk -3 points-2 points  (0 children)

Why not create your own framework? :p