Skip to content

Mongoose on Nuttx RTOS - serving static files from FS #1439

Discussion options

You must be logged in to vote

Mongoose uses "virtual" file system API to access files. By default, it implements a POSIX interface, and a "packed" interface. User can implement its own custom interface, using whatever filesystem available. The filesystem interface can be specified as a struct mg_http_serve_opt :: fs member. If it is left as NULL, then whatever available API is used (which is POSIX).

So, the answer to your question is: implement your own custom filesystem API, and specify it in the struct mg_http_serve_opts. You can take a look at the example at

struct mg_fs fs = mg_fs_posix;
fs.stat = my_stat;
struct mg_http_serve_opts o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cpq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants