A dead simple and fast web server for C++. Inspired in Python's Flask. Still have issues with high loads.
The code is as simple as
#include <iostream>
#include "concorde.h"
REGISTER_METHOD(login, "/index",
[](const HttpRequest& request) {
return "Hola Mundo";
});
int main(int argc, const char * argv[]) {
concorde::Server serv(2235);
serv.run();
return 0;
}
This will bring up a server on port 2235 which listens for post requests on /login and get requests on /index.html.
No prerequisites.
Running with the precompiled library, just add the library when compiling. eg: g++ -std=c++11 -o mymain mymain.cpp -lconcorde
Be sure to include src/libconcorde.so
in your LD_LIBRARY_PATH. Alternatively you can use the param "-L/my/path/to/libconcorde.so"
to compile your project.
To build the project from scratch clone the repo please first install boost (brew install boost
on MacOs).
Then you need to cp the googletest directory:
cp -r googletest-master googletest
Then initialize git submodules and update them:
git submodule init
git submodule update
finally build the project
make
make install
make tests
Optionally you can rebuild the buildsystem using cmake:
cmake .
This should generate src/libconcorde.so
which you can use when linking your code.
Use ctest
or make tests && ./tests
to run the tests.
XCode and / or G++ on Linux.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Andres Paez MArtinez - Initial work - Apaezmx.
This project is licensed under the MIT License - see the LICENSE.md file for details
- Inspired in Flask. Fast simple and easy to use!
- Using httpparser by nekipelov