mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Merge branch 'master' into catch_all
This commit is contained in:
commit
4aae614297
4
.coveralls.yml
Normal file
4
.coveralls.yml
Normal file
@ -0,0 +1,4 @@
|
||||
service_name: drone-io
|
||||
gcov_options: \-lp
|
||||
include:
|
||||
- include
|
35
.drone.yml
35
.drone.yml
@ -15,24 +15,26 @@ steps:
|
||||
|
||||
commands:
|
||||
- export DEBIAN_FRONTEND=noninteractive
|
||||
- export TRAVIS_BRANCH=$DRONE_SOURCE_BRANCH
|
||||
- apt-get -y update
|
||||
- apt-get -y install libboost-all-dev doxygen mkdocs graphviz zlib1g-dev gcc clang make cmake python3 python3-pip git
|
||||
- pip3 install mkdocs-material cpp-coveralls
|
||||
- pip3 install mkdocs-material cpp-coveralls pyyaml
|
||||
- export CC=/usr/bin/gcc
|
||||
- export CXX=/usr/bin/g++
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
- make -j4 && ctest -V -j4
|
||||
- make -j4
|
||||
- ctest -V -j4
|
||||
- cd ..
|
||||
- coveralls --verbose --exclude-pattern .*/http_parser_merged.h --exclude-pattern .*/TinySHA1.hpp
|
||||
- export CC=/usr/bin/clang
|
||||
- export CXX=/usr/bin/clang++
|
||||
- mkdir build-clang
|
||||
- cd build-clang
|
||||
- cmake ..
|
||||
- make -j4 && ctest -V -j4
|
||||
- cd ..
|
||||
- coveralls -i include --exclude-pattern .*/http_parser_merged.h --exclude-pattern .*/TinySHA1.hpp --gcov-options '\-lp'
|
||||
- make -j4
|
||||
- ctest -V -j4
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
@ -60,14 +62,16 @@ steps:
|
||||
- cd build
|
||||
- cmake --version
|
||||
- cmake ..
|
||||
- make -j4 && ctest -V -j4
|
||||
- make -j4
|
||||
- ctest -V -j4
|
||||
- cd ..
|
||||
- export CC=/usr/bin/clang
|
||||
- export CXX=/usr/bin/clang++
|
||||
- mkdir build-clang
|
||||
- cd build-clang
|
||||
- cmake ..
|
||||
- make -j4 && ctest -V -j4
|
||||
- make -j4
|
||||
- ctest -V -j4
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
@ -100,24 +104,27 @@ steps:
|
||||
- export DRONE_BUILD_DIR=$PWD
|
||||
- export DEBIAN_FRONTEND=noninteractive
|
||||
- export DOXYFILE=$DRONE_BUILD_DIR/Doxyfile
|
||||
- export TRAVIS_BRANCH=$DRONE_REPO_BRANCH
|
||||
- apt-get -y update
|
||||
- apt-get -y install libboost-all-dev doxygen mkdocs graphviz zlib1g-dev gcc clang make cmake python3 python3-pip git
|
||||
- pip3 install mkdocs-material cpp-coveralls
|
||||
- pip3 install mkdocs-material cpp-coveralls pyyaml
|
||||
- export CC=/usr/bin/gcc
|
||||
- export CXX=/usr/bin/g++
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
- make -j4 && ctest -V -j4
|
||||
- make -j4
|
||||
- ctest -V -j4
|
||||
- cd ..
|
||||
- coveralls --verbose --exclude-pattern .*/http_parser_merged.h --exclude-pattern .*/TinySHA1.hpp
|
||||
- export CC=/usr/bin/clang
|
||||
- export CXX=/usr/bin/clang++
|
||||
- mkdir build-clang
|
||||
- cd build-clang
|
||||
- cmake ..
|
||||
- make -j4 && ctest -V -j4
|
||||
- make -j4
|
||||
- ctest -V -j4
|
||||
- cd ..
|
||||
- coveralls -i include --exclude-pattern .*/http_parser_merged.h --exclude-pattern .*/TinySHA1.hpp --gcov-options '\-lp'
|
||||
- chmod +x scripts/generateDocumentationAndDeploy.sh
|
||||
- ./scripts/generateDocumentationAndDeploy.sh
|
||||
|
||||
@ -147,14 +154,16 @@ steps:
|
||||
- cd build
|
||||
- cmake --version
|
||||
- cmake ..
|
||||
- make -j4 && ctest -V -j4
|
||||
- make -j4
|
||||
- ctest -V -j4
|
||||
- cd ..
|
||||
- export CC=/usr/bin/clang
|
||||
- export CXX=/usr/bin/clang++
|
||||
- mkdir build-clang
|
||||
- cd build-clang
|
||||
- cmake ..
|
||||
- make -j4 && ctest -V -j4
|
||||
- make -j4
|
||||
- ctest -V -j4
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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.";
|
||||
|
||||
|
@ -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:
|
||||
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user