|
|
@ -1,7 +1,7 @@ |
|
|
|
#include <bakatools.h> |
|
|
|
#include <bakatools.h> |
|
|
|
#include <bakanet.h> |
|
|
|
#include <bakanet.h> |
|
|
|
|
|
|
|
|
|
|
|
#define PORT 80 |
|
|
|
#define PORT 8080 |
|
|
|
|
|
|
|
|
|
|
|
using namespace Bk::Net; |
|
|
|
using namespace Bk::Net; |
|
|
|
|
|
|
|
|
|
|
@ -17,11 +17,11 @@ int main() |
|
|
|
res.body = "<p>Coucou de /</p>"; |
|
|
|
res.body = "<p>Coucou de /</p>"; |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
}); |
|
|
|
}); |
|
|
|
server.get("/home/", [](HttpRequest& req) |
|
|
|
server.post("/home/", [](HttpRequest& req) |
|
|
|
{ |
|
|
|
{ |
|
|
|
BK_INFO("URL /home"); |
|
|
|
HttpReponse res(HTTP_RES_200, "HTTP/1.1"); |
|
|
|
HttpReponse res(HTTP_RES_200, req.version); |
|
|
|
res.body = "Success"; |
|
|
|
res.body = "<p>Coucou de /home/</p>"; |
|
|
|
BK_INFO("\n{0}\n{1}", req.body, res.to_string()); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
}); |
|
|
|
}); |
|
|
|
server.start(); |
|
|
|
server.start(); |
|
|
|