mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
Fix mongoose docs generation
PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
This commit is contained in:
1 parent
ab000c684a
commit
3eb4eb8074
166 files changed
+3125
No files matched your search
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: "mg_http_serve_file()"
|
||||
decl_name: "mg_http_serve_file"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_http_serve_file(struct mg_connection *nc, struct http_message *hm,
|
||||
const char *path, const struct mg_str mime_type,
|
||||
const struct mg_str extra_headers);
|
||||
---
|
||||
|
||||
Serves a specific file with a given MIME type and optional extra headers.
|
||||
|
||||
Example code snippet:
|
||||
|
||||
```c
|
||||
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
switch (ev) {
|
||||
case MG_EV_HTTP_REQUEST: {
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
mg_http_serve_file(nc, hm, "file.txt",
|
||||
mg_mk_str("text/plain"), mg_mk_str(""));
|
||||
break;
|
||||
}
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user