webCode/Cpp/testHTTP/MyHttp/main.cpp
2023-10-05 23:07:15 +08:00

26 lines
560 B
C++

/*
g++ -o main main.cpp -std=c++11 -lwfrest -lworkflow -lz -Wl,-rpath=/usr/local/lib
*/
#include "wfrest/HttpServer.h"
#include <cstdio>
#include <iostream>
#include <string>
#include <wfrest/HttpContent.h>
#include <wfrest/HttpMsg.h>
#include <workflow/URIParser.h>
using namespace wfrest;
int main(){
HttpServer sv;
sv.GET("/",[](const HttpReq *req,HttpResp *resp)->void{
});
if (sv.start(8888)==0) {
getchar();
sv.stop();
}else {
fprintf(stderr,"Cannot open port 8888 and start the server!!");
}
}