Qt5 based web framework
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
src
.gitignore
.travis.yml
CMakeLists.txt
LICENSE
README.md

README.md

Crocodile

Qt5 based web framework

#include <httpserver.h>
#include <httprequest.h>
#include <httpresponse.h>

#include <QCoreApplication>

HttpResponse indexHandler(const HttpRequest &request) {
    Q_UNUSED(request)

    HttpResponse response;
    response.setStatus(200);
    response.setContentType(QStringLiteral("text/html"));
    response.setBody(QStringLiteral("<h1>Hello World</h1>"));
    return response;
}

int main(int argc, char **argv)
{
    QCoreApplication app(argc, argv);
    HttpServer server;
    server.handleRoute("/", indexHandler);
    server.listen(QHostAddress::LocalHost, 8000);
    return app.exec();
}

Installation

After cloning the repository, execute the following commands to install Crocodile

# Make sure you are in project root directory
cd lib
mkdir build
cd build
cmake ..
make
make install

Now, build the Crocodile executable which automates the creation of basic structure of an app

# Make sure you are in project root directory
mkdir build
cd build
cmake ..
make

Now Crocodile is executable is ready. Proceed to How to section to create your first app with Crocodile!

$ ./Crocodile --help
Usage: ./Crocodile [options]

Options:
  -h, --help     Displays this help.
  -v, --version  Displays version information.
  --create-app   Creates crocodile application

How to

Create App

$ ./Crocodile --create-app