Http web server helps statically serves files from a directory. More...
#include <HttpWebServer.h>
Public Member Functions | |
Result | init (StringView directoryToServe) |
Initialize the web server on the given file system directory to serve. More... | |
Result | stopAsync () |
Release all resources allocated by this web server. More... | |
void | serveFile (HttpRequest &request, HttpResponse &response) |
Serve the efile requested by this Http Client on its channel Call this method in response to HttpServer::onRequest to serve a file. More... | |
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 | ( | StringView | directoryToServe | ) |
Initialize the web server on the given file system directory to serve.
void SC::HttpWebServer::serveFile | ( | HttpRequest & | request, |
HttpResponse & | response | ||
) |
Serve the efile 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.