summaryrefslogtreecommitdiff
path: root/fw/app/src/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/app/src/http.c')
-rw-r--r--fw/app/src/http.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fw/app/src/http.c b/fw/app/src/http.c
index e206f86..08b59c1 100644
--- a/fw/app/src/http.c
+++ b/fw/app/src/http.c
@@ -34,6 +34,21 @@ struct http_resource_detail_static index_resource_detail = {
.static_data_len = sizeof(index_html_gz),
};
+static const uint8_t css_gz[] = {
+ #include "simple.css.gz.inc"
+};
+
+struct http_resource_detail_static css_resource_detail = {
+ .common = {
+ .type = HTTP_RESOURCE_TYPE_STATIC,
+ .bitmask_of_supported_http_methods = BIT(HTTP_GET),
+ .content_encoding = "gzip",
+ .content_type = "text/css",
+ },
+ .static_data = css_gz,
+ .static_data_len = sizeof(css_gz),
+};
+
static const uint8_t js_html_gz[] = {
#include "iot-contact.js.gz.inc"
};
@@ -95,6 +110,7 @@ HTTP_SERVICE_DEFINE(http_service, NULL, &http_port, 1, 10, NULL, NULL);
HTTP_RESOURCE_DEFINE(index_resource, http_service, "/", &index_resource_detail);
HTTP_RESOURCE_DEFINE(websocket_resource, http_service, "/", &websocket_resource_detail);
HTTP_RESOURCE_DEFINE(favicon_resource, http_service, "/favicon.ico", &favicon_resource_detail);
+HTTP_RESOURCE_DEFINE(css_resource, http_service, "/simple.css", &css_resource_detail);
HTTP_RESOURCE_DEFINE(js_resource, http_service, "/iot-contact.js", &js_resource_detail);
int init_http_server(void) {