drogon
C++14/17-based HTTP application framework
Loading...
Searching...
No Matches
drogon::plugin::Redirector Class Reference

This plugin is used to redirect requests to proper URLs. It is a helper plugin for other plugins, e.g. SlashRemover. Users can register a handler to this plugin to redirect requests. All handlers will be called in the order of registration. The json configuration is as follows: More...

#include <drogon/plugins/Redirector.h>

Inheritance diagram for drogon::plugin::Redirector:
Collaboration diagram for drogon::plugin::Redirector:

Public Member Functions

void initAndStart (const Json::Value &config) override
void shutdown () override
void registerRedirectHandler (RedirectorHandler &&handler)
void registerRedirectHandler (const RedirectorHandler &handler)
void registerPathRewriteHandler (PathRewriteHandler &&handler)
void registerPathRewriteHandler (const PathRewriteHandler &handler)
void registerForwardHandler (ForwardHandler &&handler)
void registerForwardHandler (const ForwardHandler &handler)
Public Member Functions inherited from drogon::PluginBase
void initialize ()
 This method must be called by drogon.
Public Member Functions inherited from drogon::DrObject< Redirector >
const std::string & className () const override
 Get the class name.
bool isClass (const std::string &class_name) const override
 Return true if the class name is 'class_name'.

Additional Inherited Members

Static Public Member Functions inherited from drogon::DrObject< Redirector >
static const std::string & classTypeName ()

Detailed Description

This plugin is used to redirect requests to proper URLs. It is a helper plugin for other plugins, e.g. SlashRemover. Users can register a handler to this plugin to redirect requests. All handlers will be called in the order of registration. The json configuration is as follows:

{
"name": "drogon::plugin::Redirector",
"dependencies": [],
"config": {
}
}

Member Function Documentation

◆ initAndStart()

void drogon::plugin::Redirector::initAndStart ( const Json::Value & config)
overridevirtual

This method must be called by drogon to initialize and start the plugin. It must be implemented by the user.

Implements drogon::PluginBase.

◆ shutdown()

void drogon::plugin::Redirector::shutdown ( )
overridevirtual

This method must be called by drogon to shutdown the plugin. It must be implemented by the user.

Implements drogon::PluginBase.


The documentation for this class was generated from the following file: