DarkflameServer/dChatServer/ChatWebAPI.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
504 B
C
Raw Normal View History

#ifndef CHATWEBAPI_H
#define CHATWEBAPI_H
2025-01-02 06:45:53 +00:00
#include "mongoose.h"
2025-01-02 06:45:53 +00:00
#include "json_fwd.hpp"
#include "GeneralUtils.h"
2025-01-02 06:45:53 +00:00
using json = nlohmann::json;
class ChatWebAPI {
public:
ChatWebAPI();
2025-01-02 06:45:53 +00:00
~ChatWebAPI();
void ReceiveRequests();
void Listen();
2025-01-02 06:45:53 +00:00
private:
struct mg_mgr mgr;
static void HandleRequests(struct mg_connection *c, int ev, void *ev_data);
inline static const std::string root_path = "/api/v1/";
inline static const char * json_content_type = "Content-Type: application/json\r\n";
2025-01-02 06:45:53 +00:00
};
#endif