2023-10-05 15:07:15 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
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>
|
2023-10-14 07:48:44 +00:00
|
|
|
#include "ztool.hpp"
|
|
|
|
|
2023-10-05 15:07:15 +00:00
|
|
|
using namespace wfrest;
|
|
|
|
int main(){
|
|
|
|
|
|
|
|
HttpServer sv;
|
|
|
|
sv.GET("/",[](const HttpReq *req,HttpResp *resp)->void{
|
2023-10-14 07:48:44 +00:00
|
|
|
resp->String("Hello "+ +" !");
|
2023-10-05 15:07:15 +00:00
|
|
|
});
|
|
|
|
if (sv.start(8888)==0) {
|
|
|
|
getchar();
|
|
|
|
sv.stop();
|
|
|
|
}else {
|
|
|
|
fprintf(stderr,"Cannot open port 8888 and start the server!!");
|
|
|
|
}
|
|
|
|
}
|