better client for friends

This commit is contained in:
2026-07-24 10:18:30 +10:00
parent 6598162680
commit 0d3c76086b
7 changed files with 127 additions and 31 deletions

View File

@@ -13,6 +13,7 @@ sources = [
'src/generated/friends.cpp',
'src/generated/script_friends.cpp',
'src/generated/style.cpp',
'src/generated/style_friends.cpp',
'src/generated/script.cpp',
'src/generated/notify.cpp',

View File

@@ -27,6 +27,7 @@ using Json = nlohmann::json;
#include "generated/friends.h"
#include "generated/script_friends.h"
#include "generated/style.h"
#include "generated/style_friends.h"
#include "generated/script.h"
#include "generated/notify.h"
@@ -60,6 +61,7 @@ int main() {
const bin2cpp::File& friendsjsfile = bin2cpp::getScript_friendsJsFile();
const bin2cpp::File& e404file = bin2cpp::getE404HtmlFile();
const bin2cpp::File& stylefile = bin2cpp::getStyleCssFile();
const bin2cpp::File& friendscssfile = bin2cpp::getStyle_friendsCssFile();
const bin2cpp::File& scriptfile = bin2cpp::getScriptJsFile();
const bin2cpp::File& notifyfile = bin2cpp::getNotifyOpusFile();
@@ -70,6 +72,7 @@ int main() {
std::string settings{settingsfile.getBuffer(), settingsfile.getSize()};
std::string friends{friendsfile.getBuffer(), friendsfile.getSize()};
std::string friendsjs{friendsjsfile.getBuffer(), friendsjsfile.getSize()};
std::string friendscss{friendscssfile.getBuffer(), friendscssfile.getSize()};
std::string e404{e404file.getBuffer(), e404file.getSize()};
std::string style{stylefile.getBuffer(), stylefile.getSize()};
std::string script{scriptfile.getBuffer(), scriptfile.getSize()};
@@ -87,6 +90,10 @@ int main() {
response.set_content(style, "text/css");
});
svr.Get("/style_friends.css", [&friendscss](const httplib::Request& request, httplib::Response& response) {
response.set_content(friendscss, "text/css");
});
svr.Get("/script.js", [&script](const httplib::Request& request, httplib::Response& response) {
response.set_content(script, "text/javascript");
});