change TestView.csp
This commit is contained in:
parent
388f97d729
commit
a9b6c9896f
|
@ -17,4 +17,5 @@ endforeach()
|
|||
AUX_SOURCE_DIRECTORY(static_link_example DIR_STATIC)
|
||||
|
||||
add_executable(webapp ${DIR_STATIC} ${VIEWSRC})
|
||||
add_dependencies(webapp drogon_ctl)
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
<%inc
|
||||
#include <iostream>
|
||||
%>
|
||||
<%c++
|
||||
std::cout<<"this is a Http backend rendering Test"<<std::endl;
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<%c++ std::string title=@@.get<std::string>("title");%>
|
||||
|
|
|
@ -4,6 +4,6 @@ void TestViewCtl::asyncHandleHttpRequest(const HttpRequest& req,std::function<vo
|
|||
//write your application logic here
|
||||
drogon::HttpViewData data;
|
||||
data.insert("title",std::string("TestView"));
|
||||
std::unique_ptr<HttpResponse> res=std::unique_ptr<HttpResponse>(drogon::HttpResponse::newHttpViewResponse("TestViewClone",data));
|
||||
std::unique_ptr<HttpResponse> res=std::unique_ptr<HttpResponse>(drogon::HttpResponse::newHttpViewResponse("TestView",data));
|
||||
callback(*res);
|
||||
}
|
Loading…
Reference in New Issue