美文网首页
c++ crow框架使用示例

c++ crow框架使用示例

作者: 一路向后 | 来源:发表于2021-01-26 22:57 被阅读0次

1.源码实现

#include <crow.h>

int main()
{
        crow::SimpleApp app;

        CROW_ROUTE(app, "/")([](){
                return "Hello world";
        });

        app.port(18080).multithreaded().run();
}

2.编译源码

$ g++ -o helloworld helloworld.cpp  -I$HOME/local/include -std=c++11 -lboost_system -lpthread

3.运行程序

$ ./helloworld

相关文章

网友评论

      本文标题:c++ crow框架使用示例

      本文链接:https://www.haomeiwen.com/subject/csanzktx.html