diff --git a/Makefile b/Makefile index 305e0f1b..70756874 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ HEADERS = \ CYCLONE_SOURCES = \ cyclone/common/cpu_endian.c \ cyclone/common/os_port_posix.c \ + cyclone/common/fs_port_posix.c \ cyclone/common/date_time.c \ cyclone/common/debug.c \ cyclone/common/path.c \ diff --git a/include/fs_port_config.h b/include/fs_port_config.h new file mode 100644 index 00000000..e69de29b diff --git a/include/os_port_config.h b/include/os_port_config.h index eefd13d6..ec05d494 100644 --- a/include/os_port_config.h +++ b/include/os_port_config.h @@ -29,4 +29,6 @@ #ifndef _OS_PORT_CONFIG_H #define _OS_PORT_CONFIG_H +#define HTTP_SERVER_FS_SUPPORT ENABLED + #endif diff --git a/src/server.c b/src/server.c index 3e5ae15a..ecad57c2 100644 --- a/src/server.c +++ b/src/server.c @@ -43,9 +43,15 @@ typedef struct error_t (*handler)(HttpConnection *connection, const char_t *uri); } request_type_t; +error_t handleWww(HttpConnection *connection, const char_t *uri) +{ + return httpSendResponse(connection, &uri[4]); +} + /* const for now. later maybe dynamic? */ request_type_t request_paths[] = { // {REQ_ANY, "/reverse", &handle_reverse}, + {REQ_GET, "/www", &handleWww}, {REQ_GET, "/v1/time", &handleCloudTime}, {REQ_GET, "/v1/ota", &handleCloudOTA}, {REQ_GET, "/v1/claim", &handleCloudClaim}, diff --git a/www/test.txt b/www/test.txt new file mode 100644 index 00000000..274c0052 --- /dev/null +++ b/www/test.txt @@ -0,0 +1 @@ +1234 \ No newline at end of file