mirror of
https://github.com/drogonframework/drogon.git
synced 2025-08-10 00:01:14 -04:00
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)
|
AUX_SOURCE_DIRECTORY(static_link_example DIR_STATIC)
|
||||||
|
|
||||||
add_executable(webapp ${DIR_STATIC} ${VIEWSRC})
|
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>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<%c++ std::string title=@@.get<std::string>("title");%>
|
<%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
|
//write your application logic here
|
||||||
drogon::HttpViewData data;
|
drogon::HttpViewData data;
|
||||||
data.insert("title",std::string("TestView"));
|
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);
|
callback(*res);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user