Skip to content

Commit 301a419

Browse files
committed
Updated README
1 parent fcbcbd5 commit 301a419

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ svr.listen_after_bind();
5151

5252
```cpp
5353
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");
5459
```
5560

5661
```cpp
@@ -62,6 +67,25 @@ svr.set_base_dir("./www1", "/public"); // 1st order
6267
svr.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

0 commit comments

Comments
 (0)