#ifndef __FILESERVER_H__
#define __FILESERVER_H__

#include <QObject>
#include <httplib.h>
#include <stdint.h>
#include <QThread>

class FileServer : public QObject
{
    Q_OBJECT

public:
    explicit FileServer(QObject *parent = nullptr);
    ~FileServer();

    std::string addr() const;
    uint16_t port() const;
    bool isRunning() const;
    void run(const char *addr, unsigned short port);
    void stop();

private:
    std::string m_addr;
    uint16_t m_port;
    httplib::Server m_server;
    QThread m_thread;

signals:
    void monitorConfigureUpdate();

private slots:
    void run_hhttp_sever();

};

#endif // FILESERVER_H