after playing around with some basics I'd like serve an index.html from spiffs with mongoose.
I started with an example from mongoose docs.
Code: Select all
.....
#define MG_ENABLE_FILESYSTEM 1
#include "mongoose.h"
....
void mongoose_event_handler(struct mg_connection *nc, int ev, void *evData) {
struct http_message *hm = (struct http_message *) evData;
struct mg_serve_http_opts opts = { .document_root = "/spiffs/" };
switch (ev) {
case MG_EV_HTTP_REQUEST:
mg_serve_http(nc, hm, opts);
break;
default:
break;
}
}
After taking a look to mongoose.h, i found an if statement upon mg_serve_http_opts
which leeds me to define MG_ENABLE_FILESYSTEM.
mg_serve_http still stays unreserved and it seems there is no other switch for this.
I didn't see using defines for running mongoose before,
whats going wrong?
regards,
linuxpaul