Style things a little

This commit is contained in:
2026-07-20 11:48:27 +10:00
parent e1751a3ece
commit c3e39d5714
7 changed files with 95 additions and 27 deletions

View File

@@ -1,10 +1,8 @@
#include <exception>
#include <iostream>
#include <mutex>
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <vector>
#include "httplib/httplib.h"
@@ -15,16 +13,16 @@
#include "generated/header.h"
#include "generated/footer.h"
#include "generated/style.h"
int main() {
const bin2cpp::File& headerfile = bin2cpp::getHeaderHtmlFile();
const bin2cpp::File& footerfile = bin2cpp::getFooterHtmlFile();
const bin2cpp::File& stylefile = bin2cpp::getStyleCssFile();
std::string header{headerfile.getBuffer(), headerfile.getSize()};
std::string footer{footerfile.getBuffer(), footerfile.getSize()};
//std::vector<Post> posts = {};
//std::unordered_map<std::string, std::string> users = {};
std::string style{stylefile.getBuffer(), stylefile.getSize()};
Database database{"chookchat.db"};
@@ -32,6 +30,10 @@ int main() {
httplib::Server svr;
svr.Get("/style.css", [&style](const httplib::Request& request, httplib::Response& response) {
response.set_content(style, "text/css");
});
svr.Get("/", [&header, &footer, &database, &data_mutex](const httplib::Request& request, httplib::Response& response) {
std::cout << "requested /" << std::endl;