Fotobot
Get data from your photovoltaic plant
requestmapper.cpp
Go to the documentation of this file.
1 
7 #include "requestmapper.h"
8 #include "static.h"
9 #include "staticfilecontroller.h"
10 
21 #ifdef GENTOO
23 #endif
24 
26  :HttpRequestHandler(parent) {}
27 
28 void RequestMapper::service(HttpRequest& request, HttpResponse& response) {
29  QByteArray path=request.getPath();
30 
31  qWarning() << "Web request:" << path;
32 
33  if (path.startsWith("/login")) {
34  LoginController().service(request, response);
35  }
36 
37  else if (path == "/") {
38  MainPageController().service(request, response);
39  }
40 
41  else if (path.startsWith("/settings")) {
42  SettingsController().service(request, response);
43  }
44 
45  else if (path.startsWith("/export")) {
46  ExportController().service(request, response);
47  }
48 
49  else if (path.startsWith("/lines")) {
50  LinesController().service(request, response);
51  }
52 
53  else if (path.startsWith("/invertors")) {
54  InvertorsController().service(request, response);
55  }
56 
57  else if (path.startsWith("/interfaceboxes")) {
58  InterfaceboxesController().service(request, response);
59  }
60 
61  else if (path.startsWith("/geocoordinates")) {
62  GeoController().service(request, response);
63  }
64 
65 #ifdef GENTOO
66  else if (path.startsWith("/network")) {
67  NetworkController().service(request, response);
68  }
69 #endif
70 
71  else if (path.startsWith("/status")) {
72  StatusController().service(request, response);
73  }
74 
75  else if (path.startsWith("/users")) {
76  UsersController().service(request, response);
77  }
78 
79  // All other pathes are mapped to the static file controller.
80  else {
81  Static::staticFileController->service(request, response);
82  }
83 }
static StaticFileController * staticFileController
Definition: static.h:60
void service(HttpRequest &request, HttpResponse &response)
status controller
RequestMapper(QObject *parent=0)
XML export controller.
void service(HttpRequest &request, HttpResponse &response)
void service(HttpRequest &request, HttpResponse &response)