File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ svr.listen_after_bind();
51
51
52
52
``` cpp
53
53
svr.set_base_dir(" ./www" ); // This is same as `svr.set_base_dir("./www", "/")`;
54
+
55
+ // User defined file extension and MIME type mappings
56
+ svr.set_file_extension_and_mimetype_mapping(" cc" , " text/x-c" );
57
+ svr.set_file_extension_and_mimetype_mapping(" cpp" , " text/x-c" );
58
+ svr.set_file_extension_and_mimetype_mapping(" hh" , " text/x-h" );
54
59
```
55
60
56
61
``` cpp
@@ -62,6 +67,25 @@ svr.set_base_dir("./www1", "/public"); // 1st order
62
67
svr.set_base_dir(" ./www2" , " /public" ); // 2nd order
63
68
```
64
69
70
+ The followings are built-in mappings:
71
+
72
+ | Extension | MIME Type |
73
+ | :--------- | :--------------------- |
74
+ | .txt | text/plain |
75
+ | .html .htm | text/html |
76
+ | .css | text/css |
77
+ | .jpeg .jpg | image/jpg |
78
+ | .png | image/png |
79
+ | .gif | image/gif |
80
+ | .svg | image/svg+xml |
81
+ | .ico | image/x-icon |
82
+ | .json | application/json |
83
+ | .pdf | application/pdf |
84
+ | .js | application/javascript |
85
+ | .wasm | application/wasm |
86
+ | .xml | application/xml |
87
+ | .xhtml | application/xhtml+xml |
88
+
65
89
### Logging
66
90
67
91
``` cpp
You can’t perform that action at this time.
0 commit comments