Skip to content

Commit

Permalink
Merge branch 'master' into coveralls_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
The-EDev committed Apr 7, 2021
2 parents 570ed2e + c3fcda1 commit 9213118
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
6 changes: 5 additions & 1 deletion docs/getting_started/your_first_application.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
This page shows how you can get started with a simple hello world application.

##1. Include
Starting with an empty `main.cpp` file, add `#!cpp #include "crow.h"` or `#!cpp #include "crow_all.h"` if you're using the single header file.
Starting with an empty `main.cpp` file, add `#!cpp #CROW_MAIN` then `#!cpp #include "crow.h"` or `#!cpp #include "crow_all.h"` if you're using the single header file.

!!! note

If you're using multiple C++ source files make sure to have `#CROW_MAIN` defined only in your main source file.

##2. App declaration
Next Create a `main()` and declare a `#!cpp crow::SimpleApp` inside, your code should look like this
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If you want crow to run in a subdirectory (such as `domain.abc/crow`) you can us

!!! note

If you're using an Arch Linux based OS. You will have to access `/etc/httpd/conf/httpd.conf` to enable modules and change configuration
If you're using an Arch Linux based OS. You will have to access `/etc/httpd/conf/httpd.conf` to enable modules and change configuration.

##Nginx

Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ else ()
target_link_libraries(basic_example PUBLIC ${REQUIRED_LIBRARIES})

if (Tcmalloc_FOUND)
target_link_libraries(basic_example ${Tcmalloc_LIBRARIES})
target_link_libraries(basic_example PRIVATE ${Tcmalloc_LIBRARIES})
endif(Tcmalloc_FOUND)

add_executable(example_with_all example_with_all.cpp)
Expand Down
2 changes: 1 addition & 1 deletion include/crow/http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace crow
});
}

CROW_LOG_INFO << server_name_ << " server is running at " << bindaddr_ <<":" << port_
CROW_LOG_INFO << server_name_ << " server is running at " << bindaddr_ <<":" << acceptor_.local_endpoint().port()
<< " using " << concurrency_ << " threads";
CROW_LOG_INFO << "Call `app.loglevel(crow::LogLevel::Warning)` to hide Info level logs.";

Expand Down
10 changes: 9 additions & 1 deletion scripts/nginx_mime2cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def main():
"#include <string>",
"",
"namespace crow {",
"",
"#ifdef CROW_MAIN"
tabspace + "std::unordered_map<std::string, std::string> mime_types {"])

with open(file_path, "r") as mtfile:
Expand All @@ -40,7 +42,13 @@ def main():
outLines.extend(mime_line_to_cpp(splitLine))

outLines[-1] = outLines[-1][:-1]
outLines.extend([tabspace + "};", "}"])
outLines.extend([
tabspace + "};",
"#else",
"extern std::unordered_map<std::string, std::string> mime_types;",
"#endif",
"}"
])

with open(output_path, "w") as mtcppfile:
mtcppfile.writelines(x + '\n' for x in outLines)
Expand Down

0 comments on commit 9213118

Please sign in to comment.