Http web server helps statically serves files from a directory. More...
#include <HttpWebServer.h>
Public Member Functions | |
| Result | init (StringSpan directoryToServe) |
| Initialize the web server on the given file system directory to serve. | |
| Result | stopAsync () |
| Release all resources allocated by this web server. | |
| void | serveFile (HttpRequest &request, HttpResponse &response) |
| Serve the file requested by this Http Client on its channel Call this method in response to HttpServer::onRequest to serve a file. | |
Http web server helps statically serves files from a directory.
It can be used in conjunction with SC::HttpServer, by calling SC::HttpWebServer::serveFile inside the SC::HttpServer::onRequest callback to statically serve files.
| Result SC::HttpWebServer::init | ( | StringSpan | directoryToServe | ) |
Initialize the web server on the given file system directory to serve.
| void SC::HttpWebServer::serveFile | ( | HttpRequest & | request, |
| HttpResponse & | response ) |
Serve the file requested by this Http Client on its channel Call this method in response to HttpServer::onRequest to serve a file.
| Result SC::HttpWebServer::stopAsync | ( | ) |
Release all resources allocated by this web server.