mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
19 lines
328 B
C++
19 lines
328 B
C++
//
|
|
// hello.cc
|
|
//
|
|
// Copyright (c) 2019 Yuji Hirose. All rights reserved.
|
|
// MIT License
|
|
//
|
|
|
|
#include <httplib.h>
|
|
using namespace httplib;
|
|
|
|
int main(void) {
|
|
Server svr;
|
|
|
|
svr.Get("/hi", [](const Request & /*req*/, Response &res) {
|
|
res.set_content("Hello World!", "text/plain");
|
|
});
|
|
|
|
svr.listen("0.0.0.0", 8080);
|
|
}
|