Skip to content
Newer
Older
100644 44 lines (28 sloc) 1.24 KB
80297b2 @d5 updated README and ignore list
authored
1 # node.native
c46d634 @d5 Update README.md
authored
2
4c9f7c3 @d5 update README
authored
3 <b>node.native</b> is a [C++11](http://en.wikipedia.org/wiki/C%2B%2B11) (aka C++0x) port for [node.js](https://github.com/joyent/node).
de0b366 @d5 moved from libuv11
authored
4
4c9f7c3 @d5 update README
authored
5 Please note that <b>node.native</b> project is <em>under heavy development</em>: currently experimental.
fa9fea5 @d5 updated README
authored
6
7 ## Sample code
8
9 Simplest web-server example using node.native.
10
79cf062 @d5 Update README.md
authored
11 #include <iostream>
fa9fea5 @d5 updated README
authored
12 #include "http.h"
13 using namespace native::http;
14
15 int main()
16 {
da66f5e @d5 loop::run_default() static method removed; added native::run() instea…
authored
17 http server;
18 if(server.listen("0.0.0.0", 8080, [](request& req, response& res){
19 res.set_status(200);
20 res.set_header("Content-Type", "text/plain");
21 res.end("C++ FTW\n");
22 })) std::cout << "Server running at http://0.0.0.0:8080/" << std::endl;
23
24 return native::run();
fa9fea5 @d5 updated README
authored
25 }
79cf062 @d5 Update README.md
authored
26
33ff600 @d5 Update README.md
authored
27 ## Getting started
28
29 <em>node.native</em> consists of header files(*.h) only, but requires [libuv](https://github.com/joyent/libuv) and [http-parser](https://github.com/joyent/http-parser) lib to use.
30
31 To compile included sample application(sample.cpp):
32
33 export LIBUV_PATH=/path/to/libuv_dir
34 export HTTP_PARSER_PATH=/path/to/http-parser_dir
35
36 then,
37
38 make
39
4c9f7c3 @d5 update README
authored
40 I tested the code on Ubuntu 11.10 and GCC 4.6.1.
33ff600 @d5 Update README.md
authored
41
4c9f7c3 @d5 update README
authored
42 ## Todos
43
44 - Match class and function names to those of Node.js as best as possible.
Something went wrong with that request. Please try again.