2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
42#include "express/middleware/VHost.h"
44#ifndef DOXYGEN_SHOULD_SKIP_THIS
48namespace express::middleware {
52 use(
"/", [&host
= this->host]
MIDDLEWARE(req, res, next) {
53 if (req->
get("Host") == host) {
63 static std::map<std::string, std::shared_ptr<
class VHost>> vHostMiddlewares;
65 if (!vHostMiddlewares.contains(host)) {
66 vHostMiddlewares[host] = std::shared_ptr<
VHost>(
new VHost(host
));
69 return *vHostMiddlewares[host];
73 class VHost& VHost(
const std::string& host) {
#define MIDDLEWARE(req, res, next)
void operator()(const std::string &how="") const
const std::string & get(const std::string &key, int i=0) const
VHost(const std::string &host)
static class VHost & instance(const std::string &host)