diff options
author | HampusM <hampus@hampusmat.com> | 2022-05-16 08:30:59 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-05-16 08:30:59 +0200 |
commit | 6aa69cdcd8720d835e922323cdcf79147c9b3154 (patch) | |
tree | 9693e15d4b744e9f81b8c62f7a8a36ad11c920bf | |
parent | 39e2964b0315faeac0c9f8431334ba10093b9490 (diff) |
refactor(minion): create http OK response constant
-rw-r--r-- | minion/src/gymnasiearbete.cpp | 3 | ||||
-rw-r--r-- | minion/src/http/response_status.hpp | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/minion/src/gymnasiearbete.cpp b/minion/src/gymnasiearbete.cpp index b31cf81..a1f6d51 100644 --- a/minion/src/gymnasiearbete.cpp +++ b/minion/src/gymnasiearbete.cpp @@ -1,4 +1,5 @@ #include "http/request.hpp" +#include "http/response_status.hpp" #include "secrets.hpp" #include "wifi_module.hpp" @@ -101,7 +102,7 @@ void loop() Serial.print("\nData: "); Serial.println(request.data()); - wifi_module.send_response(connection, 200U, "hello there!"); + wifi_module.send_response(connection, HTTP_RESPONSE_STATUS_OK, "hello there!"); wifi_module.close_connection(connection); diff --git a/minion/src/http/response_status.hpp b/minion/src/http/response_status.hpp new file mode 100644 index 0000000..577eedd --- /dev/null +++ b/minion/src/http/response_status.hpp @@ -0,0 +1,3 @@ +#pragma once + +constexpr auto HTTP_RESPONSE_STATUS_OK = 200U; |