// Copyright 2021 Jeisson Hidalgo-Cespedes. Universidad de Costa Rica. CC BY 4.0 // Serial web server's initial code for parallelization #ifdef WEBSERVER #include "HttpServer.hpp" #include "FactWebApp.hpp" #include "StaticFileApp.hpp" // TODO(you): Register a signal handler for Ctrl+C and kill, and stop the server // TODO(you): Optional: Make your signal handler print the thread id running it /// Start the web server int main(int argc, char* argv[]) { // Create the web server HttpServer httpServer; // Create a factorization web application, and other apps if you want FactWebApp factWebApp; StaticFileApp staticFileApp; // Register the web application(s) with the web server. Static and // 404 not found apps must be the last ones in the chain httpServer.chainWebApp(&factWebApp); httpServer.chainWebApp(&staticFileApp); // Run the web server return httpServer.run(argc, argv); } #endif // WEBSERVER