Skip to content
/ qtwebapp Public
forked from reMarkable/qtwebapp

QtWepApp is a HTTP server library in C++, inspired by Java Servlets. Forked from: http://stefanfrings.de/qtwebapp/index-en.html

License

Notifications You must be signed in to change notification settings

efauk/qtwebapp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QtWebApp GitLab CI Build Status Travis Build Status License

This library was forked from http://stefanfrings.de/qtwebapp/index-en.html

QtWebApp is a library to develop server-side web applications in C++. It depends on Qt5.

The library comes with 3 components:

  • HttpServer
  • TemplateEngine
  • Logging

Usage

This short example demonstrates how to use the library:

class DefaultRequestHandler : public HttpRequestHandler
{
public:
	void service(HttpRequest &request, HttpResponse &response);
}

void DefaultRequestHandler::service(HttpRequest &request, HttpResponse &response)
{
	response.write("<html><body><h1>" + request.getPath() + "</h1></body></html>");
}

int main(int argc, char **argv)
{
	QCoreApplication app(argc, argv);
	
	QSettings *config = new QSettings;
	// ...
	
	new HttpListener(config, new DefaultRequestHandler);
	return app.exec();
}

You can the compile it using cmake, like this:

# ...
find_package(QtWebApp REQUIRED COMPONENTS HttpServer)
add_executable(thinkofabettername main.cpp)
target_link_libraries(thinkofabettername ${QtWebApp_LIBRARIES})
# ...

Build

QtWebApp uses CMake as the build system. To compile, simply run:

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install

About

QtWepApp is a HTTP server library in C++, inspired by Java Servlets. Forked from: http://stefanfrings.de/qtwebapp/index-en.html

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 94.2%
  • CMake 4.6%
  • Other 1.2%