aboutsummaryrefslogtreecommitdiffstats
path: root/example.cpp
diff options
context:
space:
mode:
authoripkn <ipknhama@gmail.com>2014-04-17 10:06:41 -0400
committeripkn <ipknhama@gmail.com>2014-04-17 10:06:41 -0400
commit86433135f3428cfd3f0184f10411bc169e2ae9b9 (patch)
tree0ebdbf7559ef73c1e69c3f6b0c6627cff422cfcc /example.cpp
parentd908a2657e67f436f8158436d69c496aab94bdaa (diff)
downloadcrow-86433135f3428cfd3f0184f10411bc169e2ae9b9.tar.gz
crow-86433135f3428cfd3f0184f10411bc169e2ae9b9.zip
response can return json object
Diffstat (limited to 'example.cpp')
-rw-r--r--example.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/example.cpp b/example.cpp
index 54efccf..16116a8 100644
--- a/example.cpp
+++ b/example.cpp
@@ -1,4 +1,5 @@
#include "flask.h"
+#include "json.h"
#include <sstream>
@@ -14,7 +15,9 @@ int main()
FLASK_ROUTE(app, "/json")
([]{
- return "{\"message\":\"Hello, World!\"}";
+ flask::json::wvalue x;
+ x["message"] = "Hello, World!";
+ return x;
});
FLASK_ROUTE(app, "/about")