parent
1fbd6426cd
commit
4e42346bad
4 changed files with 25 additions and 6 deletions
@ -0,0 +1,23 @@ |
|||||||
|
#include <bakatools.h> |
||||||
|
#include <bakanet.h> |
||||||
|
|
||||||
|
#define PORT 80 |
||||||
|
|
||||||
|
using namespace Bk::Net; |
||||||
|
|
||||||
|
int main()
|
||||||
|
{ |
||||||
|
Bk::Log::init("Bakanet"); |
||||||
|
IpAddress ip; |
||||||
|
HttpServer server(ip, PORT); |
||||||
|
server.get("/", [](HttpRequest& req) |
||||||
|
{ |
||||||
|
HttpReponse res(HTTP_RES_200, req.version); |
||||||
|
res.body = "<h1>Bakanet</h1>"; |
||||||
|
res.body += "<p>Working http server</p>"; |
||||||
|
res.body += "\n<p>URL /</p>"; |
||||||
|
return res; |
||||||
|
}); |
||||||
|
server.start(); |
||||||
|
return 0; |
||||||
|
} |
Loading…
Reference in New Issue