Add docker file for running on server.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user