mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added a new Middleware class.
This commit is contained in:
parent
d873312915
commit
ef18e705f4
14
core/http/middleware.cpp
Normal file
14
core/http/middleware.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
#include "middleware.h"
|
||||
|
||||
#include "request.h"
|
||||
|
||||
bool Middleware::on_before_handle_request_main(Request *request) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Middleware::Middleware() {
|
||||
}
|
||||
|
||||
Middleware::~Middleware() {
|
||||
}
|
21
core/http/middleware.h
Normal file
21
core/http/middleware.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef MIDDLEWARE_H
|
||||
#define MIDDLEWARE_H
|
||||
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/reference.h"
|
||||
|
||||
class Request;
|
||||
|
||||
class Middleware : public Reference {
|
||||
RCPP_OBJECT(Middleware, Reference);
|
||||
|
||||
public:
|
||||
//returnring true means handled, false, means continue
|
||||
virtual bool on_before_handle_request_main(Request *request);
|
||||
|
||||
Middleware();
|
||||
~Middleware();
|
||||
};
|
||||
|
||||
#endif
|
@ -24,6 +24,7 @@ class Request;
|
||||
|
||||
//Update the rest of the modules to the new systems
|
||||
|
||||
//remove middleware stack from request
|
||||
|
||||
class WebRoot : public WebRouterNode {
|
||||
RCPP_OBJECT(WebRoot, WebRouterNode);
|
||||
|
Loading…
Reference in New Issue
Block a user