From 7e1b4ee58c1c088cd5c1bdb9aa58df0e1a239ad9 Mon Sep 17 00:00:00 2001 From: mnpk Date: Wed, 10 Jun 2015 15:53:58 +0900 Subject: Add the very basic example, and Update README.md --- examples/CMakeLists.txt | 4 ++++ examples/helloworld.cpp | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 examples/helloworld.cpp (limited to 'examples') diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 6b42d49..1350865 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -7,6 +7,10 @@ target_link_libraries(example_vs ${Boost_LIBRARIES}) target_link_libraries(example_vs ${CMAKE_THREAD_LIBS_INIT}) else () +add_executable(helloworld helloworld.cpp) +target_link_libraries(helloworld ${Boost_LIBRARIES}) +target_link_libraries(helloworld ${CMAKE_THREAD_LIBS_INIT}) + add_executable(example example.cpp) #target_link_libraries(example crow) target_link_libraries(example ${Boost_LIBRARIES}) diff --git a/examples/helloworld.cpp b/examples/helloworld.cpp new file mode 100644 index 0000000..8b77490 --- /dev/null +++ b/examples/helloworld.cpp @@ -0,0 +1,13 @@ +#include "crow.h" + +int main() +{ + crow::SimpleApp app; + + CROW_ROUTE(app, "/") + ([]() { + return "Hello world!"; + }); + + app.port(18080).run(); +} -- cgit v1.2.3-54-g00ecf