1
0
mirror of synced 2025-04-21 22:25:55 +03:00

Updated README

This commit is contained in:
yhirose 2019-12-26 19:48:57 -05:00
parent fcbcbd53bd
commit 301a419c02

View File

@ -51,6 +51,11 @@ svr.listen_after_bind();
```cpp ```cpp
svr.set_base_dir("./www"); // This is same as `svr.set_base_dir("./www", "/")`; svr.set_base_dir("./www"); // This is same as `svr.set_base_dir("./www", "/")`;
// User defined file extension and MIME type mappings
svr.set_file_extension_and_mimetype_mapping("cc", "text/x-c");
svr.set_file_extension_and_mimetype_mapping("cpp", "text/x-c");
svr.set_file_extension_and_mimetype_mapping("hh", "text/x-h");
``` ```
```cpp ```cpp
@ -62,6 +67,25 @@ svr.set_base_dir("./www1", "/public"); // 1st order
svr.set_base_dir("./www2", "/public"); // 2nd order svr.set_base_dir("./www2", "/public"); // 2nd order
``` ```
The followings are built-in mappings:
| Extension | MIME Type |
| :--------- | :--------------------- |
| .txt | text/plain |
| .html .htm | text/html |
| .css | text/css |
| .jpeg .jpg | image/jpg |
| .png | image/png |
| .gif | image/gif |
| .svg | image/svg+xml |
| .ico | image/x-icon |
| .json | application/json |
| .pdf | application/pdf |
| .js | application/javascript |
| .wasm | application/wasm |
| .xml | application/xml |
| .xhtml | application/xhtml+xml |
### Logging ### Logging
```cpp ```cpp