// API module for serving embedded web content
#ifndef API_H
#define API_H

#include <libwebsockets.h>

// Embedded file session data structure for managing buffer lifetime
struct embedded_file_session_data {
    int type; // 1 for embedded file
    const unsigned char* data;
    size_t size;
    const char* content_type;
    int headers_sent;
    int body_sent;
};

// Handle HTTP request for embedded API files
int handle_embedded_file_request(struct lws* wsi, const char* requested_uri);

// Generate stats JSON from database queries
char* generate_stats_json(void);

#endif // API_H