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();
5151
5252``` cpp
5353svr.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" );
5459```
5560
5661``` cpp
@@ -62,6 +67,25 @@ svr.set_base_dir("./www1", "/public"); // 1st order
6267svr.set_base_dir(" ./www2" , " /public" ); // 2nd order
6368```
6469
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+
6589### Logging
6690
6791``` cpp
You can’t perform that action at this time.
0 commit comments