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.
32 lines
566 B
32 lines
566 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 /"); |
|
return HttpReponse("", ""); |
|
}); |
|
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; |
|
} |
|
|
|
|
|
|
|
|