Rename to .cc, fix Makefile bugs, add example_clock
This commit is contained in:
18
example_simple.cc
Normal file
18
example_simple.cc
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <gflags/gflags.h>
|
||||
#include <glog/logging.h>
|
||||
|
||||
#include "fastcgi.h"
|
||||
|
||||
DEFINE_int32(port, 9000, "TCP port to bind");
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
google::InitGoogleLogging(argv[0]);
|
||||
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||
|
||||
FastCGIServer server(FLAGS_port, [](std::unique_ptr<FastCGIRequest> request) {
|
||||
request->WriteHeader("Content-Type", "text/plain");
|
||||
request->WriteBody("Hello world");
|
||||
request->End();
|
||||
});
|
||||
server.Serve();
|
||||
}
|
||||
Reference in New Issue
Block a user