Add docker file for running on server.

This commit is contained in:
douwe
2025-08-06 02:21:02 +02:00
parent 357d2d48bc
commit 44530f3287
7 changed files with 143 additions and 14 deletions

View File

@@ -2,11 +2,18 @@
#include "server.hpp"
void Douwco::Server::setup() {
CROW_ROUTE(crowApp, "/")([](){
std::string page = crow::mustache::load("home.html").render_string();
return page;
#define CREATE_ROUTE(route_path, html_path) \
CROW_ROUTE(this->crowApp, route_path) \
([]() { \
std::string page = crow::mustache::load(html_path).render_string(); \
return page; \
});
void Douwco::Server::setup() {
CREATE_ROUTE("/", "home.html");
CREATE_ROUTE("/about_me", "about_me.html");
CREATE_ROUTE("/about_douwco", "about_douwco.html");
CREATE_ROUTE("/games", "games.html");
}
void Douwco::Server::start() {
@@ -15,4 +22,4 @@ void Douwco::Server::start() {
.multithreaded()
// .ssl_file("dev_cert/certificate.pem","dev_cert/private.key")
.run();
}
}