From a9b6c9896f2f5c32e0e39cc98ebf010ff0bbd888 Mon Sep 17 00:00:00 2001 From: an-tao <20741618@qq.com> Date: Wed, 30 May 2018 13:59:12 +0800 Subject: [PATCH] change TestView.csp --- examples/CMakeLists.txt | 1 + examples/static_link_example/TestView.csp | 6 ++++++ examples/static_link_example/TestViewCtl.cc | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 5ceea3ed..7aab1c1d 100755 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -17,4 +17,5 @@ endforeach() AUX_SOURCE_DIRECTORY(static_link_example DIR_STATIC) add_executable(webapp ${DIR_STATIC} ${VIEWSRC}) +add_dependencies(webapp drogon_ctl) diff --git a/examples/static_link_example/TestView.csp b/examples/static_link_example/TestView.csp index 6c24f561..7f6084d7 100755 --- a/examples/static_link_example/TestView.csp +++ b/examples/static_link_example/TestView.csp @@ -1,3 +1,9 @@ +<%inc +#include +%> +<%c++ +std::cout<<"this is a Http backend rendering Test"< <%c++ std::string title=@@.get("title");%> diff --git a/examples/static_link_example/TestViewCtl.cc b/examples/static_link_example/TestViewCtl.cc index 11b8f77c..9362b196 100755 --- a/examples/static_link_example/TestViewCtl.cc +++ b/examples/static_link_example/TestViewCtl.cc @@ -4,6 +4,6 @@ void TestViewCtl::asyncHandleHttpRequest(const HttpRequest& req,std::function res=std::unique_ptr(drogon::HttpResponse::newHttpViewResponse("TestViewClone",data)); + std::unique_ptr res=std::unique_ptr(drogon::HttpResponse::newHttpViewResponse("TestView",data)); callback(*res); } \ No newline at end of file