mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-23 11:44:53 +00:00
Support multiple web roots
This commit is contained in:
1 parent
2b48e8b03a
commit
2139fbc4b7
4 files changed
+149
-66
No files matched your search
+3
-2
@@ -915,7 +915,8 @@ enable SSI, set a `-DMG_ENABLE_SSI=1` build flag.
|
||||
Parameters:
|
||||
- `c` - connection to use
|
||||
- `hm` - http message, that should be served
|
||||
- `opts` - serve options
|
||||
- `opts` - serve options. Note that `opts.root_dir` can optionally accept
|
||||
extra comma-separated `uri=path` pairs, see example below
|
||||
|
||||
Return value: none
|
||||
|
||||
@@ -928,7 +929,7 @@ void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
|
||||
struct mg_http_serve_opts opts;
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
opts.root_dir = "/my_root";
|
||||
opts.root_dir = "/var/www,/conf=/etc"; // Serve /var/www. URIs starting with /conf are served from /etc
|
||||
mg_http_serve_dir(c, hm, &opts);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user