blob: b2f308b8e8089a32d2912fffdc973a43c55a2d7d [file] [log] [blame]
Ed Tanous911ac312017-08-15 09:37:42 -07001#pragma once
2
Ed Tanous04e438c2020-10-03 08:06:26 -07003#include <app.hpp>
Ed Tanousa8c4ce92021-03-24 08:44:51 -07004#include <http_request.hpp>
5#include <http_response.hpp>
Ed Tanousa8c4ce92021-03-24 08:44:51 -07006
7#include <string>
Ed Tanous1abe55e2018-09-05 08:30:59 -07008
Ed Tanous1abe55e2018-09-05 08:30:59 -07009namespace redfish
10{
Ed Tanousa8c4ce92021-03-24 08:44:51 -070011
Ed Tanous23a21a12020-07-25 04:45:05 +000012inline void requestRoutes(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070013{
14 BMCWEB_ROUTE(app, "/redfish/")
Ed Tanousb41187f2019-10-24 16:30:02 -070015 .methods(boost::beast::http::verb::get)(
Ed Tanous1e925c82022-05-11 14:31:08 -070016 [&app](const crow::Request& req,
17 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
18 if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
19 {
20 return;
21 }
Ed Tanous14766872022-03-15 10:44:42 -070022 asyncResp->res.jsonValue["v1"] = "/redfish/v1/";
Ed Tanous1abe55e2018-09-05 08:30:59 -070023 });
Ed Tanous3dac7492017-08-02 13:46:20 -070024}
Ed Tanous1abe55e2018-09-05 08:30:59 -070025} // namespace redfish