You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and dots ('.'), can be up to 35 characters long. Letters must be lowercase.
34 lines
643 B
34 lines
643 B
#include <bakatools.h> |
|
#include <bakanet.h> |
|
|
|
#define PORT 8000 |
|
|
|
using namespace Bk::Net; |
|
|
|
int main() |
|
{ |
|
IpAddress ip; |
|
HttpServer server(ip, PORT); |
|
server.get("/", [](HttpRequest& req) |
|
{ |
|
BK_INFO("URL /"); |
|
HttpReponse res(HTTP_RES_200, req.version); |
|
res.body = "<p>Coucou de /</p>"; |
|
return res; |
|
}); |
|
server.get("/home/", [](HttpRequest& req) |
|
{ |
|
BK_INFO("URL /home"); |
|
return HttpReponse("", ""); |
|
}); |
|
server.get("/home", [](HttpRequest& req) |
|
{ |
|
BK_INFO("URL NEW /home"); |
|
return HttpReponse("", ""); |
|
}); |
|
server.start(); |
|
return 0; |
|
} |
|
|
|
|
|
|
|
|