Changed from C# based system to own C++ implementation using crow.
This commit is contained in:
8
src/main.cpp
Normal file
8
src/main.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "server.hpp"
|
||||
|
||||
int main() {
|
||||
Douwco::Server server;
|
||||
server.setup();
|
||||
server.start();
|
||||
return 0;
|
||||
}
|
||||
18
src/server.cpp
Normal file
18
src/server.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <crow.h>
|
||||
|
||||
#include "server.hpp"
|
||||
|
||||
void Douwco::Server::setup() {
|
||||
CROW_ROUTE(crowApp, "/")([](){
|
||||
std::string page = crow::mustache::load("home.html").render_string();
|
||||
return page;
|
||||
});
|
||||
}
|
||||
|
||||
void Douwco::Server::start() {
|
||||
crowApp
|
||||
.port(port)
|
||||
.multithreaded()
|
||||
// .ssl_file("dev_cert/certificate.pem","dev_cert/private.key")
|
||||
.run();
|
||||
}
|
||||
Reference in New Issue
Block a user