Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
file_handler.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "handler.h"
4 
10 class FileHandler : public Handler {
11  std::string filePath;
12  std::string mimeType;
13  std::string cache;
14  bool binary;
15 public:
28  FileHandler(const char * route, const char * filePath, const char * mimeType, bool isBinary);
29 
33  void exec() override;
34 
45  static bool loadFile(const char * filePath, std::string & data);
46 };
this class allow you to set any file of filesystem as response body
Definition: file_handler.h:10
FileHandler(const char *route, const char *filePath, const char *mimeType, bool isBinary)
static bool loadFile(const char *filePath, std::string &data)
object of this class executes every time on new request, this object (and others) construct response ...
Definition: handler.h:13
void exec() override