Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

xatgithub/node.native

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node.native

node.native is a C++11 (aka C++0x) port for node.js.

Please note that node.native project is under heavy development.

I'm working on the first release at v0.1.0 branch.

Sample code

Simplest web-server example using node.native.

#include <iostream>
#include <native/native.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");
    })) return 1; // Failed to run server.

    std::cout << "Server running at http://0.0.0.0:8080/" << std::endl;
    return native::run();
}

Getting started

node.native consists of header files(*.h) only, but requires libuv and http-parser lib to use.

To compile included sample application(webserver.cpp):

export LIBUV_PATH=/path/to/libuv_dir
export HTTP_PARSER_PATH=/path/to/http-parser_dir

then,

make

I tested the code on Ubuntu 11.10 and GCC 4.6.1.

Other Resources

You can also access this page via http://www.nodenative.com.

About

C++11 port for Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 90.4%
  • C 9.6%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.