summaryrefslogtreecommitdiff
path: root/redfish-core/lib/redfish_v1.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-05-12 00:27:54 +0300
committerEd Tanous <ed@tanous.net>2022-05-12 19:48:07 +0300
commit4c25d66ea7b0d56ee9bbc6fa392582fb76b44911 (patch)
treeaa5bdada547478205ad86af1079dc5c7cfd5016a /redfish-core/lib/redfish_v1.hpp
parentf52c03c1bc89590965720664567381cc74a3cefc (diff)
downloadbmcweb-4c25d66ea7b0d56ee9bbc6fa392582fb76b44911.tar.xz
Move redfish v1 into redfish-core
This file has existed for a long time, and predates redfish-core, so it was put in an inopportune place. Move the code to where it should be, in lib. Tested: Code compiles. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I422c27563a5e0f2a5debb2b1d4713aa8db0fe331
Diffstat (limited to 'redfish-core/lib/redfish_v1.hpp')
-rw-r--r--redfish-core/lib/redfish_v1.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/redfish-core/lib/redfish_v1.hpp b/redfish-core/lib/redfish_v1.hpp
new file mode 100644
index 0000000000..9b5d460991
--- /dev/null
+++ b/redfish-core/lib/redfish_v1.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <app.hpp>
+#include <http_request.hpp>
+#include <http_response.hpp>
+
+#include <string>
+
+namespace redfish
+{
+
+inline void requestRoutes(App& app)
+{
+ BMCWEB_ROUTE(app, "/redfish/")
+ .methods(boost::beast::http::verb::get)(
+ [](const crow::Request&,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+ asyncResp->res.jsonValue = {{"v1", "/redfish/v1/"}};
+ });
+}
+} // namespace redfish