Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTPServer

How 2 use

#include "httpserver.h"

class IndexHandler : public HTTPRequestHandler
{
public:
    void operator()(const HTTPRequest& request, HTTPResponse& response)
    {
        response.Header("Content-Type", "text/html; charset=UTF-8");
        response.Data("hello world");
    }
};

int main()
{
    HTTPServer server;
    server.Init();
    
    server.SetHandler<IndexHandler>("/");
    
    server.SetMIME("css", "text/css");
    server.SetMIME("ico", "image/x-icon");
    server.SetMIME("png", "image/png");
    
    server.Run();
    
    server.Cleanup();
    return 0;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages