
Compiled Home Pages
- When the web site is compiled, each web page is converted into a C++
class with the same name as the web page.
- Each class has a Render method.
When the nginx web server receives a request for a web page, it creates
an instance of the appropriate class and calls its Render method.
- I created a module for nginx that must be compiled as part of nginx. This module handles files ending in .chp.
- The part of the web page before the public: keyword is put into the Render method.
The rest of the page after the public: keyword becomes class level variables and methods of the class.
- Web pages can reference other web pages and call methods from other web pages.
- There are callback methods for the class to call back into the Nginx engine.
- Each web page is given a Context variable that's used to call back into Nginx engine for commands like echo.
Context is the http_request pointer for commands in PageInfoFromWebServer.h that are used to call back to NGINX.