diff --git "a/CHN/CHN-01-\346\246\202\350\277\260.md" "b/CHN/CHN-01-\346\246\202\350\277\260.md" index 870232c..178d75c 100644 --- "a/CHN/CHN-01-\346\246\202\350\277\260.md" +++ "b/CHN/CHN-01-\346\246\202\350\277\260.md" @@ -1,6 +1,6 @@ [English](/ENG/ENG-01-Overview) | [简体中文](/CHN/CHN-01-概述) -**Drogon**是一个基于C++17/20的Http应用框架,使用Drogon可以方便的使用C++构建各种类型的Web应用服务端程序。 +**Drogon**是一个基于C++20的Http应用框架,使用Drogon可以方便的使用C++构建各种类型的Web应用服务端程序。 Drogon的主要应用平台是Linux,也支持Mac OS、FreeBSD和Windows。 @@ -29,4 +29,4 @@ Drogon的主要应用平台是Linux,也支持Mac OS、FreeBSD和Windows。 * 支持插件,可通过配置文件在加载期动态拆装; * 支持内建插入点的AOP -# 02 [安装drogon](/CHN/CHN-02-安装) +# 02 [安装drogon](/CHN/CHN-02-安装) \ No newline at end of file diff --git "a/CHN/CHN-02-\345\256\211\350\243\205.md" "b/CHN/CHN-02-\345\256\211\350\243\205.md" index ba04788..4f92ffa 100644 --- "a/CHN/CHN-02-\345\256\211\350\243\205.md" +++ "b/CHN/CHN-02-\345\256\211\350\243\205.md" @@ -18,7 +18,7 @@ * libuuid,生成uuid的c库; * zlib,用于支持压缩传输; * 可选 - * boost,版本**不低于1.61**,只在C++编译器不支持c++17或STL库不完整支持`std::filesystem`时才需要安装; + * boost,版本**不低于1.61**,只在C++编译器不支持c++20或STL库不完整支持`std::filesystem`时才需要安装; * OpenSSL,安装后drogon将支持HTTPS,否则drogon只支持HTTP; * c-ares, 安装后drogon对DNS的支持会具有更好的性能; * libbrotli,安装后drogon的HTTP响应会支持brotli压缩; diff --git a/ENG/ENG-01-Overview.md b/ENG/ENG-01-Overview.md index 9c920c1..83d54e4 100644 --- a/ENG/ENG-01-Overview.md +++ b/ENG/ENG-01-Overview.md @@ -1,6 +1,6 @@ -##### Other languages: [简体中文](/CHN//CHN//CHN/CHN-01-概述) +##### Other languages: [简体中文](/CHN/CHN-01-概述) -**Drogon** is a C++17/20-based HTTP application framework. Drogon can be used to easily build various types of web application server programs using C++. +**Drogon** is a C++20-based HTTP application framework. Drogon can be used to easily build various types of web application server programs using C++. **Drogon** is the name of a dragon in the American TV series "Game of Thrones" that I really like. @@ -31,4 +31,4 @@ Its main features are as follows: * Support plugins which can be installed by the configuration file at load time; * Support AOP with build-in joinpoints. -# Next: [Install drogon](/ENG//ENG//ENG/ENG-02-Installation) +# Next: [Install drogon](/ENG/ENG-02-Installation) \ No newline at end of file diff --git a/ENG/ENG-02-Installation.md b/ENG/ENG-02-Installation.md index 96afd0a..a9a96f1 100644 --- a/ENG/ENG-02-Installation.md +++ b/ENG/ENG-02-Installation.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN//CHN/CHN-02-安装) +##### Other languages: [简体中文](/CHN/CHN-02-安装) This section takes Ubuntu 18.04, CentOS 7.5, MacOS 12.2 as an example to introduce the installation process. Other systems are similar; @@ -291,7 +291,7 @@ Assuming that the above environment and library dependencies are all ready, the mkdir build cd build conan profile detect --force - conan install .. -s compiler="msvc" -s compiler.version=193 -s compiler.cppstd=17 -s build_type=Debug --output-folder . --build=missing + conan install .. -s compiler="msvc" -s compiler.version=193 -s compiler.cppstd=20 -s build_type=Debug --output-folder . --build=missing ``` > Modify `conanfile.txt` to change the version of dependencies. @@ -481,4 +481,5 @@ Assuming that the above environment and library dependencies are all ready, the target_link_libraries(${PROJECT_NAME} PRIVATE drogon) ``` -# Next: [Quick Start](/ENG//ENG//ENG/ENG-03-Quick-Start) + +# Next: [Quick Start](/ENG/ENG-03-Quick-Start) \ No newline at end of file diff --git a/ENG/ENG-03-Quick-Start.md b/ENG/ENG-03-Quick-Start.md index 9cd9ca2..9253a6d 100644 --- a/ENG/ENG-03-Quick-Start.md +++ b/ENG/ENG-03-Quick-Start.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN//CHN/CHN-03-快速开始) +##### Other languages: [简体中文](/CHN/CHN-03-快速开始) ## Static Site @@ -22,7 +22,11 @@ There are several useful folders in the project directory already: └── views The folder where view csp files are stored ``` -Users can put various files (such as controllers, filters, views, etc.) into the corresponding folders. For more convenience and less error, we strongly recommend that users create their own web application projects using the `drogon_ctl` command. See [drogon_ctl](/ENG//ENG/ENG-11-drogon_ctl-Command) for more details. + +Users can put various files (such as controllers, filters, views, etc.) into the corresponding folders. For more convenience and less error, we strongly recommend that users create their own web application projects using the `drogon_ctl` command. See [drogon_ctl](/ENG/ENG-11-drogon_ctl-Command) for more details. +======= +Users can put various files (such as controllers, filters, views, etc.) into the corresponding folders. For more convenience and less error, we strongly recommend that users create their own web application projects using the `drogon_ctl` command. See [drogon_ctl](/ENG/ENG-11-drogon_ctl-Command) for more details. + Let's look at the main.cc file: @@ -55,12 +59,16 @@ Now, we simply add one static file index.html to the Http root path: echo '

Hello Drogon!

' >>index.html ``` -The default root path is `"./"`, but could also be modified by config.json. See [Configuration File](/ENG//ENG/ENG-10-Configuration-File) for more details. Then you can visit this page by URL `"http://localhost"` or`"http://localhost/index.html"` (or the IP of the server where your wepapp is running). -![Hello Drogon!](images/hellodrogon.png) +The default root path is `"./"`, but could also be modified by config.json. See [Configuration File](/ENG/ENG-10-Configuration-File) for more details. Then you can visit this page by URL `"http://localhost"` or`"http://localhost/index.html"` (or the IP of the server where your wepapp is running). +======= +The default root path is `"./"`, but could also be modified by config.json. See [Configuration File](/ENG/ENG-10-Configuration-File) for more details. Then you can visit this page by URL `"http://localhost"` or`"http://localhost/index.html"` (or the IP of the server where your wepapp is running). + + +![Hello Drogon!](/images/hellodrogon.png) If the server cannot find the the page you have requested, it returns a 404 page: -![404 page](images/notfound.png) +![404 page](/images/notfound.png) > **Note: Make sure your server firewall has allowed the 80 port. Otherwise, you won't see these pages.(Another way is to change your port from 80 to 1024(or above) in case you get the error message below):** @@ -194,4 +202,5 @@ We see that adding a controller to an application is very simple. You only need > **Note: Drogon has no restrictions on the location of the controller source files. You could also save them in "./" (the project root directory), or you could even define a new directory in `CMakeLists.txt`. It is recommended to use the controllers directory for the convenience of management.** -# Next: [drogon_ctl Command](/ENG//ENG/ENG-04-0-Controller-Introduction) + +# Next: [drogon_ctl Command](/ENG/ENG-04-0-Controller-Introduction) \ No newline at end of file diff --git a/ENG/ENG-04-0-Controller-Introduction.md b/ENG/ENG-04-0-Controller-Introduction.md index 01462fc..9b02da1 100644 --- a/ENG/ENG-04-0-Controller-Introduction.md +++ b/ENG/ENG-04-0-Controller-Introduction.md @@ -1,6 +1,6 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-04-控制器-简介) +##### Other languages: [简体中文](/CHN/CHN-04-控制器-简介) -The controller is very important in web application development. This is where we will define our URLs, which HTTP methods are allowed, which [filters](/ENG//ENG/ENG-06-Middleware-and-Filter) will be applied and how requests will be processed and responded to. The drogon framework has helped us to handle the network transmission, Http protocol analysis and so on. We only need to pay attention to the logic of the controller; each controller object can have one or more processing functions (generally called handlers), and the interface of the function is generally defined as follows: +The controller is very important in web application development. This is where we will define our URLs, which HTTP methods are allowed, which [filters](/ENG/ENG-06-Middleware-and-Filter) will be applied and how requests will be processed and responded to. The drogon framework has helped us to handle the network transmission, Http protocol analysis and so on. We only need to pay attention to the logic of the controller; each controller object can have one or more processing functions (generally called handlers), and the interface of the function is generally defined as follows: ```c++ Void handlerName(const HttpRequestPtr &req, @@ -33,4 +33,5 @@ public: A controller registered to a drogon framework will have at most only one instance and will not be destroyed during the entire application run, so users can declare and use member variables in the controller class. Note that when the handler of the controller is called, it is in a multi-threaded environment (when the number of IO threads of the framework is configured to be greater than 1), if you need to access non-temporary variables, please do the concurrent protection work. -# Next: [HttpSimpleController](/ENG//ENG/ENG-04-1-Controller-HttpSimpleController) + +# Next: [HttpSimpleController](/ENG/ENG-04-1-Controller-HttpSimpleController) \ No newline at end of file diff --git a/ENG/ENG-04-1-Controller-HttpSimpleController.md b/ENG/ENG-04-1-Controller-HttpSimpleController.md index f206169..08eb2e5 100644 --- a/ENG/ENG-04-1-Controller-HttpSimpleController.md +++ b/ENG/ENG-04-1-Controller-HttpSimpleController.md @@ -1,4 +1,5 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-04-1-控制器-HttpSimpleController) +##### Other languages: [简体中文](/CHN/CHN-04-1-控制器-HttpSimpleController) + You could use the `drogon_ctl` command line tool to quickly generate custom controller class source files based on `HttpSimpleController`. The command format is as bellow: @@ -47,7 +48,11 @@ Each HttpSimpleController class can only define one Http request handler, and it The route (or called mapping) from the URL path to the handler is done by a macro. You could add multipath mappings with the `PATH_ADD` macro. All `PATH_ADD` statements should be set between the `PATH_LIST_BEGIN` and `PATH_LIST_END` macro statements. -The first parameter is the path to be mapped, and parameters beyond the path are constraints on this path. Currently, two types of constraints are supported. One is the `HttpMethod` enum Type, which means the Http method allowed. The other type is the name of the `HttpFilter` class. One can configure any number of these two types of constraints, and there are no order requirements for them. For Filter, please refer to [Middleware and Filter](/ENG//ENG/ENG-05-Middleware-and-Filter). + +The first parameter is the path to be mapped, and parameters beyond the path are constraints on this path. Currently, two types of constraints are supported. One is the `HttpMethod` enum Type, which means the Http method allowed. The other type is the name of the `HttpFilter` class. One can configure any number of these two types of constraints, and there are no order requirements for them. For Filter, please refer to [Middleware and Filter](/ENG/ENG-05-Middleware-and-Filter). +======= +The first parameter is the path to be mapped, and parameters beyond the path are constraints on this path. Currently, two types of constraints are supported. One is the `HttpMethod` enum Type, which means the Http method allowed. The other type is the name of the `HttpFilter` class. One can configure any number of these two types of constraints, and there are no order requirements for them. For Filter, please refer to [Middleware and Filter](/ENG/ENG-05-Middleware-and-Filter). + Users can register the same Simple Controller to multiple paths, or register multiple Simple Controllers on the same path (using different HTTP methods). @@ -64,4 +69,5 @@ You could define an HttpResponse class variable, and then use the callback() to > **The mapping from the above path to the handler is done at compile time. In fact, the drogon framework also provides an interface for runtime completion mapping. The runtime mapping allows the user to map or modify the mapping through configuration files or other user interfaces without recompiling this program (For performance reasons, it is forbidden to add any controller mapping after running the app().run() method).** -# Next: [HttpController](/ENG//ENG/ENG-04-2-Controller-HttpController) + +# Next: [HttpController](/ENG/ENG-04-2-Controller-HttpController) \ No newline at end of file diff --git a/ENG/ENG-04-2-Controller-HttpController.md b/ENG/ENG-04-2-Controller-HttpController.md index 65f96b6..f0a1ab0 100644 --- a/ENG/ENG-04-2-Controller-HttpController.md +++ b/ENG/ENG-04-2-Controller-HttpController.md @@ -1,4 +1,5 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-04-2-控制器-HttpController) +##### Other languages: [简体中文](/CHN/CHN-04-2-控制器-HttpController) + ### Generation @@ -279,4 +280,5 @@ Each `HttpController` class can define many Http request handlers. Since the num > **It should be noted that when using regular expressions, you should pay attention to matching conflicts (multiple different handlers are matched). When conflicts happen in the same controller, drogon will only execute the first handler (the one registered in the framework first). When conflicts happen between different controllers, it is uncertain which handler will be executed. Therefore, users need to avoid these conflicts.** -# Next: [WebSocketController](/ENG//ENG/ENG-04-3-Controller-WebSocketController) + +# Next: [WebSocketController](/ENG/ENG-04-3-Controller-WebSocketController) \ No newline at end of file diff --git a/ENG/ENG-04-3-Controller-WebSocketController.md b/ENG/ENG-04-3-Controller-WebSocketController.md index ff86940..fd5d6c7 100644 --- a/ENG/ENG-04-3-Controller-WebSocketController.md +++ b/ENG/ENG-04-3-Controller-WebSocketController.md @@ -1,4 +1,5 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-04-3-控制器-WebSocketController) +##### Other languages: [简体中文](/CHN/CHN-04-3-控制器-WebSocketController) + As the name implies, `WebSocketController` is used to process websocket logic. Websocket is a persistent HTTP-based connection scheme. At the beginning of the websocket, there is an HTTP format request and response exchange. After the websocket connection is established, all messages are transmitted on the websocket. The message is wrapped in a fixed format. There is no limit to the message content and the order in which messages are transmitted. @@ -100,7 +101,11 @@ void EchoWebsock::handleConnectionClosed(const WebSocketConnectionPtr &wsConnPtr } ``` - First, in this example, the controller is registered to the `/echo` path via the `WS_PATH_ADD` macro. The usage of the `WS_PATH_ADD` macro is similar to the macros of other controllers introduced earlier. One can also register the path with several [Filters](/ENG//ENG/ENG-05-Middleware-and-Filter). Since websocket is handled separately in the framework, it can be repeated with the paths of the first two controllers(`HttpSimpleController` and `HttpApiController`) without affecting each other. + + First, in this example, the controller is registered to the `/echo` path via the `WS_PATH_ADD` macro. The usage of the `WS_PATH_ADD` macro is similar to the macros of other controllers introduced earlier. One can also register the path with several [Filters](/ENG/ENG-05-Middleware-and-Filter). Since websocket is handled separately in the framework, it can be repeated with the paths of the first two controllers(`HttpSimpleController` and `HttpApiController`) without affecting each other. +======= + First, in this example, the controller is registered to the `/echo` path via the `WS_PATH_ADD` macro. The usage of the `WS_PATH_ADD` macro is similar to the macros of other controllers introduced earlier. One can also register the path with several [Filters](/ENG/ENG-05-Middleware-and-Filter). Since websocket is handled separately in the framework, it can be repeated with the paths of the first two controllers(`HttpSimpleController` and `HttpApiController`) without affecting each other. + Secondly, in the implementation of the three virtual functions in this example, only the handleNewMessage has the substance, but simply sends the received message back to the client through the send interface.Compile this controller into the framework, you can see the effect, please test it yourself. @@ -150,4 +155,5 @@ void EchoWebsock::handleConnectionClosed(const WebSocketConnectionPtr &wsConnPtr any *getMutableContext(); ``` -# Next: [Middleware and Filter](/ENG//ENG/ENG-05-Middleware-and-Filter) + +# Next: [Middleware and Filter](/ENG/ENG-05-Middleware-and-Filter) \ No newline at end of file diff --git a/ENG/ENG-05-Middleware-and-Filter.md b/ENG/ENG-05-Middleware-and-Filter.md index 4173cd8..a3a1120 100644 --- a/ENG/ENG-05-Middleware-and-Filter.md +++ b/ENG/ENG-05-Middleware-and-Filter.md @@ -1,6 +1,6 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-05-中间件和过滤器) +##### Other languages: [简体中文](/CHN/CHN-05-中间件和过滤器) -In HttpController's [example](/ENG//ENG/ENG-04-2-Controller-HttpController), the getInfo method should check whether the user is logged in before returning the user's information. We can write this logic in the getInfo method, but obviously, checking the user's login membership is general logic which will be used by many interfaces, it should be extracted separately and configured before calling handler, which is what filters do. +In HttpController's [example](/ENG/ENG-04-2-Controller-HttpController), the getInfo method should check whether the user is logged in before returning the user's information. We can write this logic in the getInfo method, but obviously, checking the user's login membership is general logic which will be used by many interfaces, it should be extracted separately and configured before calling handler, which is what filters do. Drogon's middleware uses the onion model. After the framework completes URL path matching, it sequentially invokes the middleware registered for that path. Within each middleware, users can choose to intercept or pass through the request and add pre-processing and post-processing logic. @@ -71,7 +71,11 @@ Drogon contains the following common filters: }; ``` - You could create filter by the `drogon_ctl` command, see [drogon_ctl](/ENG//ENG/ENG-11-drogon_ctl-command#Filter-creation). + + You could create filter by the `drogon_ctl` command, see [drogon_ctl](/ENG/ENG-11-drogon_ctl-command#Filter-creation). +======= + You could create filter by the `drogon_ctl` command, see [drogon_ctl](/ENG/ENG-11-drogon_ctl-command#Filter-creation). + You need to override the doFilter virtual function of the parent class to implement the filter logic; @@ -100,4 +104,5 @@ Drogon contains the following common filters: > **Note: If the middleware/filter is defined in the namespace, you must write the namespace completely when you register it.** -# Next: [View](/ENG//ENG/ENG-06-View) + +# Next: [View](/ENG/ENG-06-View) \ No newline at end of file diff --git a/ENG/ENG-06-View.md b/ENG/ENG-06-View.md index da77524..6b3432d 100644 --- a/ENG/ENG-06-View.md +++ b/ENG/ENG-06-View.md @@ -1,4 +1,5 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-06-视图) +##### Other languages: [简体中文](/CHN/CHN-06-视图) + ### Views Introduction @@ -151,4 +152,5 @@ Obviously, this function depends on the development environment. If both drogon > **Note: If a `symbol not found` error occurs while loading a dynamic view, please use the `cmake .. -DCMAKE_ENABLE_EXPORTS=on` to configure your project, or uncomment the last line (`set_property(TARGET ${PROJECT_NAME} PROPERTY ENABLE_EXPORTS ON)`) in your project's CMakeLists.txt, and then rebuild the project** -# Next: [Session](/ENG//ENG/ENG-07-Session) + +# Next: [Session](/ENG/ENG-07-Session) \ No newline at end of file diff --git a/ENG/ENG-07-Session.md b/ENG/ENG-07-Session.md index 89b0e58..ade83dd 100644 --- a/ENG/ENG-07-Session.md +++ b/ENG/ENG-07-Session.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-07-会话) +##### Other languages: [简体中文](/CHN/CHN-07-会话) `Session` is an important concept of the web application. It is used to save the state of the client on the server. Generally, it cooperates with the browser's `cookie`, and drogon provides support for the session. Drogon **close** the session selection by default, you can also close or open it through the following interface: @@ -96,4 +96,5 @@ drogon::HttpAppFramework::instance().enableSession(1200); Recompile the entire project with CMake, run the target program webapp, and you can see the effect through the browser. -# Next: [Database](/ENG//ENG/ENG-08-0-Database-General) + +# Next: [Database](/ENG/ENG-08-0-Database-General) \ No newline at end of file diff --git a/ENG/ENG-08-0-Database-General.md b/ENG/ENG-08-0-Database-General.md index 924e3b2..8c91e5b 100644 --- a/ENG/ENG-08-0-Database-General.md +++ b/ENG/ENG-08-0-Database-General.md @@ -1,8 +1,8 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-0-数据库-概述) +##### Other languages: [简体中文](/CHN/CHN-08-0-数据库-概述) ### General -**Drogon** has built-in database read/write engine. The operation of database connection is based on non-blocking I/O technology. Therefore, the application works in an efficient non-blocking asynchronous mode from the bottom to the upper layer, which ensures Drogon's high concurrency performance. Currently, Drogon supports PostgreSQL and MySQL databases. If you want to use a database, the development environment of the corresponding database must be installed first. Drogon will automatically detect the header files and library files of these libraries and compile the corresponding parts. For the preparation of the database development environment, see [Development Environment](/ENG//ENG/ENG-02-Installation#Database-Environment). +**Drogon** has built-in database read/write engine. The operation of database connection is based on non-blocking I/O technology. Therefore, the application works in an efficient non-blocking asynchronous mode from the bottom to the upper layer, which ensures Drogon's high concurrency performance. Currently, Drogon supports PostgreSQL and MySQL databases. If you want to use a database, the development environment of the corresponding database must be installed first. Drogon will automatically detect the header files and library files of these libraries and compile the corresponding parts. For the preparation of the database development environment, see [Development Environment](/ENG/ENG-02-Installation#Database-Environment). **Drogon** supports the sqlite3 database in order to support lightweight applications. The asynchronous interface is implemented through the thread pool, which is the same as the interfaces of the aforementioned databases. @@ -14,14 +14,27 @@ The basic class of Drogon's database is `DbClient` (this is an abstract class, t Usually, when an asynchronous interface is called, `DbClient` will randomly select one of the idle connections it manages to perform related query operations. When the result returns, `DbClient` will process the data and return it to the caller through the callback function object; Without an idle connection, the execution content will be cached. Once a connection has executed its own sql request, the pending command will be fetched from the cache to execute. -For details on `DbClient`, see [DbClient](/ENG//ENG/ENG-08-1-Database-DbClient). + +For details on `DbClient`, see [DbClient](/ENG/ENG-08-1-Database-DbClient). + +### Transaction + +The transaction object can be generated by `DbClient` to support transaction operations. In addition to the extra `rollback()` interface, the transaction object is basically the same as `DbClient`. The transaction class is `Transaction`. For details of the `Transaction` class, see [Transaction](/ENG/ENG-08-2-Database-Transaction). + +### ORM + +Drogon also provides support for **ORM**. Users can use the drogon_ctl command to read the tables in the database and generate the corresponding model source code. Then, execute the database operations of these models through the `Mapper` class template. Mapper provides simple and convenient interfaces for standard database operations, allowing users to make the additions, deletions, and changes to the table without writing sql statements. For **ORM**, please refer to [ORM](/ENG/ENG-08-3-Database-ORM) + +# Next: [DbClient](/ENG/ENG-08-1-Database-DbClient) +======= +For details on `DbClient`, see [DbClient](/ENG/ENG-08-1-Database-DbClient). ### Transaction -The transaction object can be generated by `DbClient` to support transaction operations. In addition to the extra `rollback()` interface, the transaction object is basically the same as `DbClient`. The transaction class is `Transaction`. For details of the `Transaction` class, see [Transaction](/ENG//ENG/ENG-08-2-Database-Transaction). +The transaction object can be generated by `DbClient` to support transaction operations. In addition to the extra `rollback()` interface, the transaction object is basically the same as `DbClient`. The transaction class is `Transaction`. For details of the `Transaction` class, see [Transaction](/ENG/ENG-08-2-Database-Transaction). ### ORM -Drogon also provides support for **ORM**. Users can use the drogon_ctl command to read the tables in the database and generate the corresponding model source code. Then, execute the database operations of these models through the `Mapper` class template. Mapper provides simple and convenient interfaces for standard database operations, allowing users to make the additions, deletions, and changes to the table without writing sql statements. For **ORM**, please refer to [ORM](/ENG//ENG/ENG-08-3-Database-ORM) +Drogon also provides support for **ORM**. Users can use the drogon_ctl command to read the tables in the database and generate the corresponding model source code. Then, execute the database operations of these models through the `Mapper` class template. Mapper provides simple and convenient interfaces for standard database operations, allowing users to make the additions, deletions, and changes to the table without writing sql statements. For **ORM**, please refer to [ORM](/ENG/ENG-08-3-Database-ORM) -# Next: [DbClient](/ENG//ENG/ENG-08-1-Database-DbClient) +# Next: [DbClient](/ENG/ENG-08-1-Database-DbClient) \ No newline at end of file diff --git a/ENG/ENG-08-1-Database-DbClient.md b/ENG/ENG-08-1-Database-DbClient.md index ff68808..01aa2ab 100644 --- a/ENG/ENG-08-1-Database-DbClient.md +++ b/ENG/ENG-08-1-Database-DbClient.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-1-数据库-DbClient) +##### Other languages: [简体中文](/CHN/CHN-08-1-数据库-DbClient) ### DbClient Object Construction @@ -20,7 +20,11 @@ The object obtained by the above method, the user has to find a way to persist i - This will waste time creating connections and disconnections, increasing system latency; - The interface is also a non-blocking interface. That is to say, when the user gets the DbClient object, the connection managed by the it has not been established yet. The framework does not (intentionally) provide a callback interface for successful connection establishment. Do you still have to sleep before starting the query?? This is contrary to the original intention of the asynchronous framework. -Therefore, DbClient objects should be built at the beginning of the program and held and used throughout the life time. Obviously, this work can be done entirely by the framework. So the drogon framework provides the second build method, which is built by configuration file or the `createDbClient()` method. For the configuration method of the configuration file, see [db_clients](/ENG//ENG/ENG-10-Configuration-file#db_clients). + +Therefore, DbClient objects should be built at the beginning of the program and held and used throughout the life time. Obviously, this work can be done entirely by the framework. So the drogon framework provides the second build method, which is built by configuration file or the `createDbClient()` method. For the configuration method of the configuration file, see [db_clients](/ENG/ENG-10-Configuration-file#db_clients). +======= +Therefore, DbClient objects should be built at the beginning of the program and held and used throughout the life time. Obviously, this work can be done entirely by the framework. So the drogon framework provides the second build method, which is built by configuration file or the `createDbClient()` method. For the configuration method of the configuration file, see [db_clients](/ENG/ENG-10-Configuration-file#db_clients). + When needed, the DbClient smart pointer is obtained through the interface of the framework. The interface is as follows: @@ -253,4 +257,5 @@ Each DbClient object has one or multiple its own EventLoop threads controlling t Blocking interfaces of DbClient only block the caller thread, as long as the caller thread is not the EventLoop thread, it will not affect the normal operation of the EventLoop thread. When the callback function is called, the program inside the callback is run on the EventLoop thread. Therefore, do not perform any blocking operations within the callback, otherwise it will affect the concurrency performance of database read and write. Anyone familiar with non-blocking I/O programming should understand this constraint. -# Next: [Transaction](/ENG//ENG/ENG-08-2-Database-Transaction) + +# Next: [Transaction](/ENG/ENG-08-2-Database-Transaction) \ No newline at end of file diff --git a/ENG/ENG-08-2-Database-Transaction.md b/ENG/ENG-08-2-Database-Transaction.md index fa54aac..12d6b50 100644 --- a/ENG/ENG-08-2-Database-Transaction.md +++ b/ENG/ENG-08-2-Database-Transaction.md @@ -1,4 +1,5 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-2-数据库-事务) +##### Other languages: [简体中文](/CHN/CHN-08-2-数据库-事务) + > **Transactions** are an important feature of relational databases, and Drogon provides transaction support with the `Transaction` class. @@ -83,4 +84,5 @@ For the simplest example, suppose there is a task table from which the user sele In this case, select for update is used to avoid concurrent modifications. The update statement is completed in the result callback of the select statement. The outermost braces are used to limit the scope of the transPtr so that it can be destroyed in time after the execution of sql to end the transaction. -# Next: [ORM](/ENG//ENG/ENG-08-3-Database-ORM) + +# Next: [ORM](/ENG/ENG-08-3-Database-ORM) \ No newline at end of file diff --git a/ENG/ENG-08-3-Database-ORM.md b/ENG/ENG-08-3-Database-ORM.md index 0add918..dfba292 100644 --- a/ENG/ENG-08-3-Database-ORM.md +++ b/ENG/ENG-08-3-Database-ORM.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-3-数据库-ORM) +##### Other languages: [简体中文](/CHN/CHN-08-3-数据库-ORM) ### Model @@ -30,7 +30,11 @@ The last parameter is the path to store model classes. There must be a configura } ``` -The configured parameters are the same as the application's configuration file. Please refer to [Configuration File](/ENG//ENG/ENG-10-Configuration-File#db_clients). + +The configured parameters are the same as the application's configuration file. Please refer to [Configuration File](/ENG/ENG-10-Configuration-File#db_clients). +======= +The configured parameters are the same as the application's configuration file. Please refer to [Configuration File](/ENG/ENG-10-Configuration-File#db_clients). + The `tables` configuration option is unique to the model configuration. It is an array of strings. Each string represents the name of the table to be converted into a model class. If this option is empty, all tables will be used to generate model classes. @@ -99,7 +103,11 @@ template explicit Criteria(const CustomSql &sql, Arguments &&...args) ``` -The first argument is a `CustomSql` object of sql statements with `$?` placeholders, while the `CustomSql` class is just a wrapper of a std::string. The second indefinite argument is a parameter pack represents the bound parameter, which behaves just like the ones in [execSqlAsync](/ENG//ENG/ENG-08-1-Database-DbClient.md#execSqlAsync). + +The first argument is a `CustomSql` object of sql statements with `$?` placeholders, while the `CustomSql` class is just a wrapper of a std::string. The second indefinite argument is a parameter pack represents the bound parameter, which behaves just like the ones in [execSqlAsync](/ENG/ENG-08-1-Database-DbClient.md#execSqlAsync). +======= +The first argument is a `CustomSql` object of sql statements with `$?` placeholders, while the `CustomSql` class is just a wrapper of a std::string. The second indefinite argument is a parameter pack represents the bound parameter, which behaves just like the ones in [execSqlAsync](/ENG/ENG-08-1-Database-DbClient.md#execSqlAsync). + E.g: @@ -286,4 +294,5 @@ drogon_ctl can also generate restful-style controllers for each model (or table) It should be noted that the controller of each table is designed to be composed of a base class and a subclass. Among them, the base class and the table are closely related, and the subclass is used to implement special business logic or modify the interface format. The advantage of this design is that when the table structure changes, users can update only the base class without overwriting the subclass(by setting the `generate_base_only` option to `true`). -# Next: [FastDbClient](/ENG//ENG/ENG-08-4-Database-FastDbClient) + +# Next: [FastDbClient](/ENG/ENG-08-4-Database-FastDbClient) \ No newline at end of file diff --git a/ENG/ENG-08-4-Database-FastDbClient.md b/ENG/ENG-08-4-Database-FastDbClient.md index 07922ac..39a1c5e 100644 --- a/ENG/ENG-08-4-Database-FastDbClient.md +++ b/ENG/ENG-08-4-Database-FastDbClient.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-4-数据库-FastDbClient) +##### Other languages: [简体中文](/CHN/CHN-08-4-数据库-FastDbClient) As the name implies, FastDbClient will provide higher performance than the normal DbClient. Unlike DbClient has own event loop, it shares the event loop with network IO threads and the main thread of the web application, which makes the internal implementation of FastDbClient available in a lock-free mode and more efficient. @@ -10,7 +10,11 @@ FastDbClient must be created automatically by the framework with the configurati The sub-option `is_fast` of the db_client option in the configuration file indicates if the client is a FastDbClient.Or user can create a FastDbClient by calling the app.createDbClient() method with the last parameter set to true. -The framework creates a separate FastDbClient for each IO's event loop and the main event loop, and each FastDbClient manages several database connections internally. The number of event loop of IO is controlled by the framework's "threads_num" option, which is generally set to the number of CPU cores of the host. The number of the DB connections per event loop is the value of the DB client "connection_number" option. Please refer to [Configuration File](/ENG//ENG/ENG-10-Configuration-File#db_clients). Therefore, the total number of DB connections held by FastDbClient is `(threads_num+1) * connection_number`. + +The framework creates a separate FastDbClient for each IO's event loop and the main event loop, and each FastDbClient manages several database connections internally. The number of event loop of IO is controlled by the framework's "threads_num" option, which is generally set to the number of CPU cores of the host. The number of the DB connections per event loop is the value of the DB client "connection_number" option. Please refer to [Configuration File](/ENG/ENG-10-Configuration-File#db_clients). Therefore, the total number of DB connections held by FastDbClient is `(threads_num+1) * connection_number`. +======= +The framework creates a separate FastDbClient for each IO's event loop and the main event loop, and each FastDbClient manages several database connections internally. The number of event loop of IO is controlled by the framework's "threads_num" option, which is generally set to the number of CPU cores of the host. The number of the DB connections per event loop is the value of the DB client "connection_number" option. Please refer to [Configuration File](/ENG/ENG-10-Configuration-File#db_clients). Therefore, the total number of DB connections held by FastDbClient is `(threads_num+1) * connection_number`. + The interface to get a FastDbClient is similar to the normal DbClient, as follows: @@ -30,4 +34,5 @@ The use of FastDbClient is almost identical to that of the normal DbClient, exce - Synchronous transaction creation interfaces are likely to block (when all connections are busy), so FastDbClient's synchronous transaction creation interface returns null pointers directly. If you want to use transactions on FastDbClient, please use the asynchronous transaction creation interface. - After using the FastDbClient to create an Orm Mapper object, you should also use only asynchronous non-blocking interfaces of the mapper object. -# Next: [Automatic batch mode](/ENG//ENG/ENG-08-5-Database-auto_batch) + +# Next: [Automatic batch mode](/ENG/ENG-08-5-Database-auto_batch) \ No newline at end of file diff --git a/ENG/ENG-08-5-Database-auto_batch.md b/ENG/ENG-08-5-Database-auto_batch.md index 9405996..1097120 100644 --- a/ENG/ENG-08-5-Database-auto_batch.md +++ b/ENG/ENG-08-5-Database-auto_batch.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-5-数据库-自动批处理) +##### Other languages: [简体中文](/CHN/CHN-08-5-数据库-自动批处理) The automatic batch mode is only valid for the client library of postgresql 14+ version, and will be ignored in other cases. Before talking about automatic batch processing, let's understand the pipeline mode first. @@ -33,4 +33,5 @@ Therefore, automatic batch mode is helpful to improve performance, but it is not When using the newPgClient interface to create a client, set the third parameter to true to enable automatic batch mode; When using a configuration file to create a client, set the auto_batch option to true to enable automatic batch mode for the client; -# Next: [Request References](/ENG//ENG/ENG-09-0-References-request) + +# Next: [Request References](/ENG/ENG-09-0-References-request) \ No newline at end of file diff --git a/ENG/ENG-09-0-References-request.md b/ENG/ENG-09-0-References-request.md index 7896981..c32809b 100644 --- a/ENG/ENG-09-0-References-request.md +++ b/ENG/ENG-09-0-References-request.md @@ -1,5 +1,3 @@ - - The HttpRequest type pointer commonly named `req` in the examples in this documentation represents the data contained in a request received or sent by drogon, below are the some methods by which you can interact with this object: - ### `isOnSecureConnection()` @@ -87,7 +85,11 @@ The HttpRequest type pointer commonly named `req` in the examples in this docume path() #### Summary: - Function that returns the request path. Useful if you use an ADD_METHOD_VIA_REGEX or other type of dynamic URL in the [controller](/ENG//ENG/ENG-04-2-Controller-HttpController). + + Function that returns the request path. Useful if you use an ADD_METHOD_VIA_REGEX or other type of dynamic URL in the [controller](/ENG/ENG-04-2-Controller-HttpController). +======= + Function that returns the request path. Useful if you use an ADD_METHOD_VIA_REGEX or other type of dynamic URL in the [controller](/ENG/ENG-04-2-Controller-HttpController). + #### Inputs: None. @@ -265,6 +267,7 @@ void mycontroller::postfile(const HttpRequestPtr &req, std::function //create model classes in model_path - #### View creation - The `dg_ctl create view` command is used to generate source files from csp files, see the [View](/ENG//ENG/ENG-07-View) section. In general, this command does not need to be used directly. It is better practice to configure the cmake file to executed this command automatically. The command example is as follows, assuming the csp file is `UsersList.csp`. + + The `dg_ctl create view` command is used to generate source files from csp files, see the [View](/ENG/ENG-07-View) section. In general, this command does not need to be used directly. It is better practice to configure the cmake file to executed this command automatically. The command example is as follows, assuming the csp file is `UsersList.csp`. +======= + The `dg_ctl create view` command is used to generate source files from csp files, see the [View](/ENG/ENG-07-View) section. In general, this command does not need to be used directly. It is better practice to configure the cmake file to executed this command automatically. The command example is as follows, assuming the csp file is `UsersList.csp`. + ```shell dg_ctl create view UsersList.csp @@ -95,7 +99,11 @@ drogon_ctl create model //create model classes in model_path - #### Filter creation - The `dg_ctl create filter` command is used to help the user create the source files for filters, see the [Middleware and Filter](/ENG//ENG/ENG-06-Middleware-and-Filter) section. + + The `dg_ctl create filter` command is used to help the user create the source files for filters, see the [Middleware and Filter](/ENG/ENG-06-Middleware-and-Filter) section. +======= + The `dg_ctl create filter` command is used to help the user create the source files for filters, see the [Middleware and Filter](/ENG/ENG-06-Middleware-and-Filter) section. + ```shell dg_ctl create filter LoginFilter @@ -151,7 +159,11 @@ drogon_ctl create model //create model classes in model_path #include "models/User.h" ``` - Note that the models directory name is included to distinguish between multiple data sources in the same project. See [ORM](/ENG//ENG/ENG-08-3-Database-ORM). + + Note that the models directory name is included to distinguish between multiple data sources in the same project. See [ORM](/ENG/ENG-08-3-Database-ORM). +======= + Note that the models directory name is included to distinguish between multiple data sources in the same project. See [ORM](/ENG/ENG-08-3-Database-ORM). + ### Stress Testing @@ -169,4 +181,5 @@ dg_ctl press -n1000000 -t4 -c1000 -q http://localhost:8080/ dg_ctl press -n 1000000 -t 4 -c 1000 https://www.domain.com/path/to/be/tested ``` -# Next: [Controller Introduction](/ENG//ENG/ENG-05-0-Controller-Introduction) + +# Next: [Controller Introduction](/ENG/ENG-05-0-Controller-Introduction) \ No newline at end of file diff --git a/ENG/ENG-13-AOP-Aspect-Oriented-Programming.md b/ENG/ENG-13-AOP-Aspect-Oriented-Programming.md index 2a6c81c..35561a8 100644 --- a/ENG/ENG-13-AOP-Aspect-Oriented-Programming.md +++ b/ENG/ENG-13-AOP-Aspect-Oriented-Programming.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-12-AOP面向切面编程) +##### Other languages: [简体中文](/CHN/CHN-12-AOP面向切面编程) AOP(Aspect Oriented Programming) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns(Quoted from Wikipedia). @@ -30,4 +30,5 @@ The following figure shows the location of the above four joinpoints in the HTTP ![](images/AOP.png) -# 13 [Benchmarks](/ENG//ENG/ENG-13-Benchmarks) + +# 13 [Benchmarks](/ENG/ENG-13-Benchmarks) \ No newline at end of file diff --git a/ENG/ENG-14-Benchmarks.md b/ENG/ENG-14-Benchmarks.md index 0ed07a0..6c38382 100644 --- a/ENG/ENG-14-Benchmarks.md +++ b/ENG/ENG-14-Benchmarks.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-13-性能测试) +##### Other languages: [简体中文](/CHN/CHN-13-性能测试) As a C++ Http application framework, performance should be one of the focus of attention. This section introduces Drogon's simple tests and achievements; @@ -47,4 +47,5 @@ The image below is a screenshot of a test: ![Test Result](images/benchmark.png) -# 14 [Causal profiling with coz](/ENG//ENG/ENG-14-Coz) + +# 14 [Causal profiling with coz](/ENG/ENG-14-Coz) \ No newline at end of file diff --git a/ENG/ENG-15-Coz.md b/ENG/ENG-15-Coz.md index 6c162af..c9ee89b 100644 --- a/ENG/ENG-15-Coz.md +++ b/ENG/ENG-15-Coz.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-14-Coz分析) +##### Other languages: [简体中文](/CHN/CHN-14-Coz分析) ## Causal profiling with coz @@ -23,4 +23,5 @@ For more information checkout: * [Git repo](https://github.com/plasma-umass/coz) * [Coz whitepaper](https://arxiv.org/pdf/1608.03676v1.pdf) -# 15 [Brotli compression](/ENG//ENG/ENG-15-Brotli) + +# 15 [Brotli compression](/ENG/ENG-15-Brotli) \ No newline at end of file diff --git a/ENG/ENG-16-Brotli.md b/ENG/ENG-16-Brotli.md index 4053684..7345c06 100644 --- a/ENG/ENG-16-Brotli.md +++ b/ENG/ENG-16-Brotli.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-15-Brotli压缩) +##### Other languages: [简体中文](/CHN/CHN-15-Brotli压缩) ## Brotli Info @@ -13,4 +13,5 @@ if you want to dynamically compress with brotli you'll have to set `use_brotli` Users who don't intend to use brotli static, might want to get rid of brotli extra 'sibling check' by setting `br_static` to `false` in `config.json`. -# 16 [Coroutines](/ENG//ENG/ENG-16-Coroutines) + +# 16 [Coroutines](/ENG/ENG-16-Coroutines) \ No newline at end of file diff --git a/ENG/ENG-17-Coroutines.md b/ENG/ENG-17-Coroutines.md index 135dbd7..530ef17 100644 --- a/ENG/ENG-17-Coroutines.md +++ b/ENG/ENG-17-Coroutines.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-16-协程) +##### Other languages: [简体中文](/CHN/CHN-16-协程) Drogon supports [C++ coroutines][1] starting from version 1.4. They provide a way to flatten the control flow of asynchronous calls, i.e. escaping the callback hell. With it, asynchronous programming becomes as easy as synchronous programming. @@ -166,4 +166,5 @@ There are some common pitfalls you may encounter when using coroutines. [1]: https://en.cppreference.com/w/cpp/language/coroutines -# 17 [Redis](/ENG//ENG/ENG-17-Redis) + +# 17 [Redis](/ENG/ENG-17-Redis) \ No newline at end of file diff --git a/ENG/ENG-18-Redis.md b/ENG/ENG-18-Redis.md index 266f2b0..2184510 100644 --- a/ENG/ENG-18-Redis.md +++ b/ENG/ENG-18-Redis.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-17-Redis) +##### Other languages: [简体中文](/CHN/CHN-17-Redis) Drogon supports Redis, a very fast, in-memory data store. Which could be used as a database cache or a message broker. Like everything in Drogon, Redis connections are asynchronous. Which ensures Drogon running with very high concurrency even under heavy load. @@ -102,7 +102,11 @@ redisClient->newTransactionAsync([](const RedisTransactionPtr &transPtr) { ### Coroutines -Redis clients support coroutines. One should use the GCC 11 or a newer compiler and use `cmake -DCMAKE_CXX_FLAGS="-std=c++20"` to enable it. See the (coroutine)[/ENG//ENG/ENG-16-Coroutines] section for more information. + +Redis clients support coroutines. One should use the GCC 11 or a newer compiler and use `cmake -DCMAKE_CXX_FLAGS="-std=c++20"` to enable it. See the (coroutine)[/ENG/ENG-16-Coroutines] section for more information. +======= +Redis clients support coroutines. One should use the GCC 11 or a newer compiler and use `cmake -DCMAKE_CXX_FLAGS="-std=c++20"` to enable it. See the (coroutine)[/ENG/ENG-16-Coroutines] section for more information. + ```c++ try @@ -118,4 +122,5 @@ catch(const std::exception& e) } ``` -# 18 [Testing Framework](/ENG//ENG/ENG-18-Testing-Framework) + +# 18 [Testing Framework](/ENG/ENG-18-Testing-Framework) \ No newline at end of file diff --git a/ENG/ENG-19-Testing-Framework.md b/ENG/ENG-19-Testing-Framework.md index 209df62..4436ded 100644 --- a/ENG/ENG-19-Testing-Framework.md +++ b/ENG/ENG-19-Testing-Framework.md @@ -1,4 +1,5 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-18-测试框架) +##### Other languages: [简体中文](/CHN/CHN-18-测试框架) + DrogonTest is a minimal testing framework built into drogon to enable easy asynchronous testing as well as synchronous ones. It is used for Drogon's own unittests and integration tests. But could also be used for testing applications built with Drogon. The syntax of DrogonTest is inspired by both [GTest](https://github.com/google/googletest) and [Catch2](https://github.com/catchorg/Catch2). diff --git a/ENG/ENG-FAQ-1-Understanding-drogon-threading-model.md b/ENG/ENG-FAQ-1-Understanding-drogon-threading-model.md index a56f565..79d06a4 100644 --- a/ENG/ENG-FAQ-1-Understanding-drogon-threading-model.md +++ b/ENG/ENG-FAQ-1-Understanding-drogon-threading-model.md @@ -1,4 +1,5 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-FAQ-1-线程模型.md) +##### Other languages: [简体中文](/CHN/CHN-FAQ-1-线程模型.md) + # Understanding Drogon's threading model diff --git a/ENG/ENG-FAQ.md b/ENG/ENG-FAQ.md index 0e55278..8ee577d 100644 --- a/ENG/ENG-FAQ.md +++ b/ENG/ENG-FAQ.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-FAQ) +##### Other languages: [简体中文](/CHN/CHN-FAQ) # FAQ @@ -6,4 +6,5 @@ This is a list of commonly asked questions and the answers, with some extended e ## What's drogon's threading model and best practices? -Drogon runs on a thread pool where the HTTP server threads as well as DB threads are created when `app().run()` is called. It is a sequential task based system. Thus it is recommended to always use the asynchronous APIs or coroutines when possible. See [Understanding drogon's threading model](/ENG//ENG/ENG-FAQ-1-Understanding-drogon-threading-model) for detail. + +Drogon runs on a thread pool where the HTTP server threads as well as DB threads are created when `app().run()` is called. It is a sequential task based system. Thus it is recommended to always use the asynchronous APIs or coroutines when possible. See [Understanding drogon's threading model](/ENG/ENG-FAQ-1-Understanding-drogon-threading-model) for detail. \ No newline at end of file diff --git a/ENG/Home.md b/ENG/Home.md index b25c5cc..9cae288 100644 --- a/ENG/Home.md +++ b/ENG/Home.md @@ -1,80 +1,81 @@ [English](Home) | [简体中文](Home.zh-CN) -### [Welcome to the drogon wiki!](/ENG//ENG/ENG-01-Overview) -* [Overview](/ENG//ENG/ENG-01-Overview) -* [Install drogon](/ENG//ENG/ENG-02-Installation) - * [System Requirements](/ENG//ENG/ENG-02-Installation#System-Requirements) - * [Library Dependencies](/ENG//ENG/ENG-02-Installation#Library-Dependencies) - * [System Preparation Examples](/ENG//ENG/ENG-02-Installation#System-Preparation-Examples) - * [Ubuntu](/ENG//ENG/ENG-02-Installation#Ubuntu-1804) - * [CentOS](/ENG//ENG/ENG-02-Installation#CentOS-75) - * [MacOS](/ENG//ENG/ENG-02-Installation#MacOS-122) - * [Windows](/ENG//ENG/ENG-02-Installation#Windows) - * [Database Environment](/ENG//ENG/ENG-02-Installation#Database-Environment) - * [PostgreSQL](/ENG//ENG/ENG-02-Installation#PostgreSQL) - * [MySQL](/ENG//ENG/ENG-02-Installation#MySQL) - * [SQLite3](/ENG//ENG/ENG-02-Installation#SQLite3) - * [Redis](/ENG//ENG/ENG-02-Installation#Redis) - * [Drogon Installation](/ENG//ENG/ENG-02-Installation#Drogon-Installation) - * [Install by source in Linux](/ENG//ENG/ENG-02-Installation#Install-by-source-in-Linux) - * [Install by source in Windows](/ENG//ENG/ENG-02-Installation#Install-by-source-in-Windows) - * [Install by vcpkg in Windows](/ENG//ENG/ENG-02-Installation#Install-by-vcpkg-in-Windows) - * [Use Docker Image](/ENG//ENG/ENG-02-Installation#Use-Docker-Image) - * [Use Nix Package](/ENG//ENG/ENG-02-Installation#Use-Nix-Package) - * [Use CPM.cmake](/CHN//CHN/CHN-02-安装#Use-CPM.cmake) - * [Include drogon source code locally](/ENG//ENG/ENG-02-Installation#Include-drogon-source-code-locally) -* [Quick Start](/ENG//ENG/ENG-03-Quick-Start) - * [Static Site](/ENG//ENG/ENG-03-Quick-Start#Static-Site) - * [Dynamic Site](/ENG//ENG/ENG-03-Quick-Start#Dynamic-Site) -* [Controller](/ENG//ENG/ENG-04-0-Controller-Introduction) - * [HttpSimpleController](/ENG//ENG/ENG-04-1-Controller-HttpSimpleController) - * [HttpController](/ENG//ENG/ENG-04-2-Controller-HttpController) - * [Path Mapping](/ENG//ENG/ENG-04-2-Controller-HttpController#Path-Mapping) - * [Parameter Mapping](/ENG//ENG/ENG-04-2-Controller-HttpController#Parameter-Mapping) - * [Multiple Path Mapping](/ENG//ENG/ENG-04-2-Controller-HttpController#Multiple-Path-Mapping) - * [Regular Expressions Mapping](/ENG//ENG/ENG-04-2-Controller-HttpController#Regular-Expressions-Mapping) - * [WebSocketController](/ENG//ENG/ENG-04-3-Controller-WebSocketController) - * [Path Mapping](/ENG//ENG/ENG-04-3-Controller-WebSocketController#Path-Mapping) - * [Interface](/ENG//ENG/ENG-04-3-Controller-WebSocketController#Interface) -* [Middleware and Filter](/ENG//ENG/ENG-05-Middleware-and-Filter) - * [Build-in Middleware/Filter](/ENG//ENG/ENG-05-Middleware-and-Filter#Built-in-Middleware/Filter) - * [Custom Middleware/Filter](/ENG//ENG/ENG-05-Middleware-and-Filter#Custom-Middleware/Filter) -* [View](/ENG//ENG/ENG-06-View) - * [Drogon's CSP](/ENG//ENG/ENG-06-View#Drogon's-CSP) - * [Automated processing of csp files](/ENG//ENG/ENG-06-View#Automated-processing-of-csp-files) - * [Dynamic compilation and loading of views](/ENG//ENG/ENG-06-View#Dynamic-compilation-and-loading-of-views) -* [Session](/ENG//ENG/ENG-07-Session) -* [Database](/ENG//ENG/ENG-08-0-Database-General) - * [DbClient](/ENG//ENG/ENG-08-1-Database-DbClient) - * [Execution Interface](/ENG//ENG/ENG-08-1-Database-DbClient#Execution-Interface) - * [execSqlAsync](/ENG//ENG/ENG-08-1-Database-DbClient#execSqlAsync) - * [execSqlAsyncFuture](/ENG//ENG/ENG-08-1-Database-DbClient#execSqlAsyncFuture) - * [execSqlSync](/ENG//ENG/ENG-08-1-Database-DbClient#execSqlSync) - * [operator<<](/ENG//ENG/ENG-08-1-Database-DbClient#operator<<) - * [Transaction](/ENG//ENG/ENG-08-2-Database-Transaction) - * [ORM](/ENG//ENG/ENG-08-3-Database-ORM) - * [Model Class Interface](/ENG//ENG/ENG-08-3-Database-ORM#Model-Class-Interface) - * [Mapper Class Template](/ENG//ENG/ENG-08-3-Database-ORM#Mapper-Class-Template) - * [Criteria](/CHN//CHN/CHN-08-3-Database-ORM#Criteria) - * [Mapper's Chain Interface](/CHN//CHN/CHN-08-3-Database-ORM#Mapper's-Chain-Interface) - * [Convert](/CHN//CHN/CHN-08-3-Database-ORM#Convert) - * [Relationships](/CHN//CHN/CHN-08-3-Database-ORM#Relationships) - * [has one](/CHN//CHN/CHN-08-3-Database-ORM#has-one) - * [has many](/CHN//CHN/CHN-08-3-Database-ORM#has-many) - * [many to many](/CHN//CHN/CHN-08-3-Database-ORM#many-to-many) - * [FastDbClient](/ENG//ENG/ENG-08-4-Database-FastDbClient) - * [Automatic batch mode](/ENG//ENG/ENG-08-5-Database-auto_batch) -* [Plugins](/ENG//ENG/ENG-09-Plugins) -* [Configuration File](/ENG//ENG/ENG-10-Configuration-File) -* [drogon_ctl Command](/ENG//ENG/ENG-11-drogon_ctl-Command) -* [AOP](/ENG//ENG/ENG-12-AOP-Aspect-Oriented-Programming) -* [Benchmarks](/ENG//ENG/ENG-13-Benchmarks) -* [Coz profiling](/ENG//ENG/ENG-14-Coz) -* [Brotli info](/ENG//ENG/ENG-15-Brotli) -* [Coroutines](/ENG//ENG/ENG-16-Coroutines) -* [Redis](/ENG//ENG/ENG-17-Redis) -* [Testing Framework](/ENG//ENG/ENG-18-Testing-Framework) -* [FAQ](/ENG//ENG/ENG-FAQ) - * [Understanding drogon's threading model](/ENG//ENG/ENG-FAQ-1-Understanding-drogon-threading-model) +### [Welcome to the drogon wiki!](/ENG/ENG-01-Overview) +* [Overview](/ENG/ENG-01-Overview) +* [Install drogon](/ENG/ENG-02-Installation) + * [System Requirements](/ENG/ENG-02-Installation#System-Requirements) + * [Library Dependencies](/ENG/ENG-02-Installation#Library-Dependencies) + * [System Preparation Examples](/ENG/ENG-02-Installation#System-Preparation-Examples) + * [Ubuntu](/ENG/ENG-02-Installation#Ubuntu-1804) + * [CentOS](/ENG/ENG-02-Installation#CentOS-75) + * [MacOS](/ENG/ENG-02-Installation#MacOS-122) + * [Windows](/ENG/ENG-02-Installation#Windows) + * [Database Environment](/ENG/ENG-02-Installation#Database-Environment) + * [PostgreSQL](/ENG/ENG-02-Installation#PostgreSQL) + * [MySQL](/ENG/ENG-02-Installation#MySQL) + * [SQLite3](/ENG/ENG-02-Installation#SQLite3) + * [Redis](/ENG/ENG-02-Installation#Redis) + * [Drogon Installation](/ENG/ENG-02-Installation#Drogon-Installation) + * [Install by source in Linux](/ENG/ENG-02-Installation#Install-by-source-in-Linux) + * [Install by source in Windows](/ENG/ENG-02-Installation#Install-by-source-in-Windows) + * [Install by vcpkg in Windows](/ENG/ENG-02-Installation#Install-by-vcpkg-in-Windows) + * [Use Docker Image](/ENG/ENG-02-Installation#Use-Docker-Image) + * [Use Nix Package](/ENG/ENG-02-Installation#Use-Nix-Package) + * [Use CPM.cmake](/CHN/CHN-02-安装#Use-CPM.cmake) + * [Include drogon source code locally](/ENG/ENG-02-Installation#Include-drogon-source-code-locally) +* [Quick Start](/ENG/ENG-03-Quick-Start) + * [Static Site](/ENG/ENG-03-Quick-Start#Static-Site) + * [Dynamic Site](/ENG/ENG-03-Quick-Start#Dynamic-Site) +* [Controller](/ENG/ENG-04-0-Controller-Introduction) + * [HttpSimpleController](/ENG/ENG-04-1-Controller-HttpSimpleController) + * [HttpController](/ENG/ENG-04-2-Controller-HttpController) + * [Path Mapping](/ENG/ENG-04-2-Controller-HttpController#Path-Mapping) + * [Parameter Mapping](/ENG/ENG-04-2-Controller-HttpController#Parameter-Mapping) + * [Multiple Path Mapping](/ENG/ENG-04-2-Controller-HttpController#Multiple-Path-Mapping) + * [Regular Expressions Mapping](/ENG/ENG-04-2-Controller-HttpController#Regular-Expressions-Mapping) + * [WebSocketController](/ENG/ENG-04-3-Controller-WebSocketController) + * [Path Mapping](/ENG/ENG-04-3-Controller-WebSocketController#Path-Mapping) + * [Interface](/ENG/ENG-04-3-Controller-WebSocketController#Interface) +* [Middleware and Filter](/ENG/ENG-05-Middleware-and-Filter) + * [Build-in Middleware/Filter](/ENG/ENG-05-Middleware-and-Filter#Built-in-Middleware/Filter) + * [Custom Middleware/Filter](/ENG/ENG-05-Middleware-and-Filter#Custom-Middleware/Filter) +* [View](/ENG/ENG-06-View) + * [Drogon's CSP](/ENG/ENG-06-View#Drogon's-CSP) + * [Automated processing of csp files](/ENG/ENG-06-View#Automated-processing-of-csp-files) + * [Dynamic compilation and loading of views](/ENG/ENG-06-View#Dynamic-compilation-and-loading-of-views) +* [Session](/ENG/ENG-07-Session) +* [Database](/ENG/ENG-08-0-Database-General) + * [DbClient](/ENG/ENG-08-1-Database-DbClient) + * [Execution Interface](/ENG/ENG-08-1-Database-DbClient#Execution-Interface) + * [execSqlAsync](/ENG/ENG-08-1-Database-DbClient#execSqlAsync) + * [execSqlAsyncFuture](/ENG/ENG-08-1-Database-DbClient#execSqlAsyncFuture) + * [execSqlSync](/ENG/ENG-08-1-Database-DbClient#execSqlSync) + * [operator<<](/ENG/ENG-08-1-Database-DbClient#operator<<) + * [Transaction](/ENG/ENG-08-2-Database-Transaction) + * [ORM](/ENG/ENG-08-3-Database-ORM) + * [Model Class Interface](/ENG/ENG-08-3-Database-ORM#Model-Class-Interface) + * [Mapper Class Template](/ENG/ENG-08-3-Database-ORM#Mapper-Class-Template) + * [Criteria](/CHN/CHN-08-3-Database-ORM#Criteria) + * [Mapper's Chain Interface](/CHN/CHN-08-3-Database-ORM#Mapper's-Chain-Interface) + * [Convert](/CHN/CHN-08-3-Database-ORM#Convert) + * [Relationships](/CHN/CHN-08-3-Database-ORM#Relationships) + * [has one](/CHN/CHN-08-3-Database-ORM#has-one) + * [has many](/CHN/CHN-08-3-Database-ORM#has-many) + * [many to many](/CHN/CHN-08-3-Database-ORM#many-to-many) + * [FastDbClient](/ENG/ENG-08-4-Database-FastDbClient) + * [Automatic batch mode](/ENG/ENG-08-5-Database-auto_batch) +* [Plugins](/ENG/ENG-09-Plugins) +* [Configuration File](/ENG/ENG-10-Configuration-File) +* [drogon_ctl Command](/ENG/ENG-11-drogon_ctl-Command) +* [AOP](/ENG/ENG-12-AOP-Aspect-Oriented-Programming) +* [Benchmarks](/ENG/ENG-13-Benchmarks) +* [Coz profiling](/ENG/ENG-14-Coz) +* [Brotli info](/ENG/ENG-15-Brotli) +* [Coroutines](/ENG/ENG-16-Coroutines) +* [Redis](/ENG/ENG-17-Redis) +* [Testing Framework](/ENG/ENG-18-Testing-Framework) +* [FAQ](/ENG/ENG-FAQ) + * [Understanding drogon's threading model](/ENG/ENG-FAQ-1-Understanding-drogon-threading-model) + ### To contribute to the wiki, please visit the [drogon-docs](https://github.com/drogonframework/drogon-docs) repository. diff --git a/index.html b/index.html index 4c5449a..8642ac9 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,11 @@ themeColor: '#1373b3', loadSidebar: '_Sidebar.md', loadFooter: '_Footer.md', +<<<<<<< HEAD homepage: '/ENG/ENG-01-Overview.md', +======= + homepage: '//ENG/ENG-01-Overview.md', +>>>>>>> 557192c59e37288b16a0d6dd1d9116101f5a08e1 name: 'Drogon docs', alias: { // Prevent unnecesary nested _Sidebar.md to be used (optional) '/.*/_Sidebar.md': '/_Sidebar.md'