Open jschmitt-mscs opened 4 years ago
Hi!
I think "the best way" depends on your case. If you have to return just static HTML content then sendfile
would be a better choice. But if you have to integrate some dynamic data into your HTML then you have to use set_body
or append_body
methods of response builder (maybe with help of some HTML template generators like jinja2cpp (a list of C++ HTML template engines can be found here)).
An example of performing database requests during the request processing can be found here.
Thanks for the help and recommendations!
Is the best way to send HTML via Restinio as a file or written out as in the examples? The below is working for me. What would be the best way to pass the parameter "test" and to make an SQL query and have the data returned into the browser?