http_page.h 799 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef HTTP_PAGE_H_
  2. #define HTTP_PAGE_H_
  3. #include <string>
  4. #include "http_parser.h"
  5. /*
  6. <!DOCTYPE html>
  7. <html>
  8. <head>
  9. <title>404 Not Found</title>
  10. </head>
  11. <body>
  12. <center><h1>404 Not Found</h1></center>
  13. <hr>
  14. </body>
  15. </html>
  16. */
  17. void make_http_status_page(http_status status_code, std::string& page);
  18. /*
  19. <!DOCTYPE html>
  20. <html>
  21. <head>
  22. <title>Index of</title>
  23. </head>
  24. <body>
  25. <h1>Index of</h1>
  26. <hr>
  27. <pre>
  28. <a href="../">../</a>
  29. <a href="images/">images/</a> 2019-08-22 19:06:05 -
  30. <a href="README.txt">README.txt</a> 2019-08-22 19:06:05 8.88K
  31. </pre>
  32. <hr>
  33. </body>
  34. </html>
  35. */
  36. void make_index_of_page(const char* dir, std::string& page, const char* url = "");
  37. #endif // HTTP_PAGE_H_