Node.nativeNode.js 的 C++ 移植版本
C++11 port for Node.js
示例代码:
#include <iostream>
#include "http.h"
using namespace native::http;
int main()
{
http server;
if(server.listen("0.0.0.0", 8080, [](request& req, response& res){
res.set_status(200);
res.set_header("Content-Type", "text/plain");
res.end("C++ FTW\n");
})) std::cout << "Server running at http://0.0.0.0:8080/" << std::endl;
return native::run();
}
评论