xref: /openbmc/bmcweb/features/redfish/lib/redfish_v1.hpp (revision d3355c5cdd4ce4e39df7d2f424eb4a60fee16731)
14c25d66eSEd Tanous #pragma once
24c25d66eSEd Tanous 
34c25d66eSEd Tanous #include <app.hpp>
44c25d66eSEd Tanous #include <http_request.hpp>
54c25d66eSEd Tanous #include <http_response.hpp>
64c25d66eSEd Tanous 
74c25d66eSEd Tanous #include <string>
84c25d66eSEd Tanous 
94c25d66eSEd Tanous namespace redfish
104c25d66eSEd Tanous {
114c25d66eSEd Tanous 
12*d3355c5cSEd Tanous inline void redfishGet(App& app, const crow::Request& req,
13*d3355c5cSEd Tanous                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
144c25d66eSEd Tanous {
151e925c84SEd Tanous     if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
161e925c84SEd Tanous     {
171e925c84SEd Tanous         return;
181e925c84SEd Tanous     }
191476687dSEd Tanous     asyncResp->res.jsonValue["v1"] = "/redfish/v1/";
20*d3355c5cSEd Tanous }
21*d3355c5cSEd Tanous 
22*d3355c5cSEd Tanous inline void requestRoutes(App& app)
23*d3355c5cSEd Tanous {
24*d3355c5cSEd Tanous     BMCWEB_ROUTE(app, "/redfish/")
25*d3355c5cSEd Tanous         .methods(boost::beast::http::verb::get)(
26*d3355c5cSEd Tanous             std::bind_front(redfishGet, std::ref(app)));
274c25d66eSEd Tanous }
284c25d66eSEd Tanous } // namespace redfish
29