Skip to content

Commit

Permalink
Update README.md and the banner image
Browse files Browse the repository at this point in the history
  • Loading branch information
an-tao committed Mar 24, 2019
1 parent 40464da commit 56eaca1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void TestCtrl::asyncHandleHttpRequest(const HttpRequestPtr& req,
}
```

**Don't be scared by the code, most of the above programs can be automatically generated by the command line tool `drogon_ctl` provided by drogon**. All the user needs to do is add their own business logic. In the example, the controller returns a `Hello, world!` string when the client accesses the `http://ip/test` URL.
**Most of the above programs can be automatically generated by the command line tool `drogon_ctl` provided by drogon** (The cammand is `drogon_ctl create controller TestCtrl`). All the user needs to do is add their own business logic. In the example, the controller returns a `Hello, world!` string when the client accesses the `http://ip/test` URL.

For JSON format response, we create the controller as follows:

Expand Down
Binary file modified drogon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions examples/simple_example_test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define RED "\033[31m" /* Red */
#define GREEN "\033[32m" /* Green */

#define JPG_LEN 44618
using namespace drogon;

void outputGood(const HttpRequestPtr &req, bool isHttps)
Expand Down Expand Up @@ -460,7 +461,7 @@ void doTest(const HttpClientPtr &client, std::promise<int> &pro, bool isHttps =
client->sendRequest(req, [=, &pro](ReqResult result, const HttpResponsePtr &resp) {
if (result == ReqResult::Ok)
{
if (resp->getBody().length() == 52594)
if (resp->getBody().length() == JPG_LEN)
{
outputGood(req, isHttps);
auto lastModified = resp->getHeader("last-modified");
Expand Down Expand Up @@ -566,7 +567,7 @@ void doTest(const HttpClientPtr &client, std::promise<int> &pro, bool isHttps =
client->sendRequest(req, [=](ReqResult result, const HttpResponsePtr &resp) {
if (result == ReqResult::Ok)
{
if (resp->getBody().length() == 52594)
if (resp->getBody().length() == JPG_LEN)
{
outputGood(req, isHttps);
}
Expand Down

0 comments on commit 56eaca1

Please sign in to comment.