summaryrefslogtreecommitdiff
path: root/minion/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-16 08:30:59 +0200
committerHampusM <hampus@hampusmat.com>2022-05-16 08:30:59 +0200
commit6aa69cdcd8720d835e922323cdcf79147c9b3154 (patch)
tree9693e15d4b744e9f81b8c62f7a8a36ad11c920bf /minion/src
parent39e2964b0315faeac0c9f8431334ba10093b9490 (diff)
refactor(minion): create http OK response constant
Diffstat (limited to 'minion/src')
-rw-r--r--minion/src/gymnasiearbete.cpp3
-rw-r--r--minion/src/http/response_status.hpp3
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;