#include "wfrest/HttpServer.h" using namespace wfrest; int main() { HttpServer svr; // Urlencoded Form // curl -v http://ip:port/post \ // -H "body-type:application/x-www-form-urlencoded" \ // -d 'user=admin&pswd=123456' svr.POST("/post", [](const HttpReq *req, Http...
cmake_minimum_required(VERSION 3.6)set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "build type")project(wfrest_demo LANGUAGES C CXX)include_directories(/usr/local/include/workflow/usr/local/include/wfrest)link_directories(/usr/local/lib)set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC -...
1.源码实现 #include<iostream>#include<wfrest/HttpServer.h>usingnamespacewfrest;intmain(){HttpServer svr;//curl -v http://ip:port/hellosvr.GET("/hello",[](constHttpReq*req,HttpResp*resp){resp->String("world\n");});// curl -v http://ip:port/datasvr.GET("/data",[](constHttp...
首先需要前往Git下载workflow与wfrest workflow:https://github.com/sogou/workflow wfrest:https://github.com/wfrest/wfrest 使用Git clone命令下载到本地,按照项目中的readme文档install项目 安装成功后,可以在/usr/local文件夹中看到libwfrest.a libworkflow.a libworkflow.so 其中.a .so分别为静态库与动态库...