|
|
|
@ -1,12 +1,13 @@ |
|
|
|
|
#include <bakatools.h> |
|
|
|
|
#include <bakanet.h> |
|
|
|
|
|
|
|
|
|
#define PORT 8000 |
|
|
|
|
#define PORT 80 |
|
|
|
|
|
|
|
|
|
using namespace Bk::Net; |
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{ |
|
|
|
|
Bk::Log::init("Bakanet"); |
|
|
|
|
IpAddress ip; |
|
|
|
|
HttpServer server(ip, PORT); |
|
|
|
|
server.get("/", [](HttpRequest& req) |
|
|
|
@ -19,12 +20,9 @@ int main() |
|
|
|
|
server.get("/home/", [](HttpRequest& req) |
|
|
|
|
{ |
|
|
|
|
BK_INFO("URL /home"); |
|
|
|
|
return HttpReponse("", ""); |
|
|
|
|
}); |
|
|
|
|
server.get("/home", [](HttpRequest& req) |
|
|
|
|
{ |
|
|
|
|
BK_INFO("URL NEW /home"); |
|
|
|
|
return HttpReponse("", ""); |
|
|
|
|
HttpReponse res(HTTP_RES_200, req.version); |
|
|
|
|
res.body = "<p>Coucou de /home/</p>"; |
|
|
|
|
return res; |
|
|
|
|
}); |
|
|
|
|
server.start(); |
|
|
|
|
return 0; |
|
|
|
|