cpp-httplip github
service code
#include "http_service.h"
#include "../json/include/nlohmann/json.hpp"
#include <iostream>
#include <sstream>
using namespace std;
using json = nlohmann::json;
void string2num(string str, double &num)
{
stringstream ss;
ss << str;
ss >> num;
}
int main(void)
{
using namespace httplib;
Server svr; // 创建服务器对象
svr.set_base_dir("../../http_service");
// 网址根目录,你看httplib源码会发现 首页默认为index.thml
svr.Get("/add", [](const Request& req, Response& res) {
json j; // json用于信息传递