Web framework C++
2.0.0
Simple web framework on c++ designed to easily create web pages, etc
|
Middleware to host directories with inner files. More...
#include <fs_middleware.h>
Public Member Functions | |
FsMiddleware (const char *nameID, const char *folderPath, const char *mountPath=nullptr) | |
bool | autoExec () override |
void | exec () override |
![]() | |
Middleware (const char *nameID) | |
virtual | ~Middleware () |
void | setContent (Request *request, Response *response) |
void | addValueToMap (const char *key, const char *value) |
bool | getValueFromMap (const char *key, std::string &value) |
std::unordered_map< std::string, std::string > * | getMap () |
std::string | getNameID () |
virtual void | clear () |
Additional Inherited Members | |
![]() | |
Request * | request |
Response * | response |
std::unordered_map< std::string, std::string > * | map |
Middleware to host directories with inner files.
This middleware provide an opportunity to share many files in directories and subdirectories by passing path to root directory and mount point of this directory.
FsMiddleware::FsMiddleware | ( | const char * | nameID, |
const char * | folderPath, | ||
const char * | mountPath = nullptr |
||
) |
create FsMiddleware to serve all files from provided directory filesystem hierarchy
nameID | string ID of this middleware |
folderPath | relative or full path to hosted folder |
mountPath | path, that would be added before relative path of files and all target requests uri should begin with this mount path |
|
overridevirtual |
check, if current request is file in hierarchy of hosted directory
Implements Middleware.
|
overridevirtual |
execute current middleware
Implements Middleware.