xref: /openbmc/bmcweb/features/redfish/lib/redfish_v1.hpp (revision 3ba0007367777144f474fdf99439ae8c03633486)
1 #pragma once
2 
3 #include <app.hpp>
4 #include <http_request.hpp>
5 #include <http_response.hpp>
6 
7 #include <string>
8 
9 namespace redfish
10 {
11 
12 inline void redfishGet(App& app, const crow::Request& req,
13                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
14 {
15     if (!redfish::setUpRedfishRoute(app, req, asyncResp))
16     {
17         return;
18     }
19     asyncResp->res.jsonValue["v1"] = "/redfish/v1/";
20 }
21 
22 inline void requestRoutesRedfish(App& app)
23 {
24     BMCWEB_ROUTE(app, "/redfish/")
25         .methods(boost::beast::http::verb::get)(
26             std::bind_front(redfishGet, std::ref(app)));
27 }
28 
29 } // namespace redfish
30