Node.js Quick Start
来自Jack's Lab
(版本间的差异)
(→Try) |
(→Try) |
||
| 第48行: | 第48行: | ||
<br><br> | <br><br> | ||
| + | |||
| + | == libcoap == | ||
| + | |||
| + | <source lang=bash> | ||
| + | #$ git clone git://git.code.sf.net/p/libcoap/code libcoap-code | ||
| + | $ git clone git://github.com/obgm/libcoap.git libcoap-code | ||
| + | $ cd libcoap-code | ||
| + | $ ./autogen.sh | ||
| + | $ | ||
| + | </source> | ||
<br><br> | <br><br> | ||
<br><br> | <br><br> | ||
2015年7月28日 (二) 18:52的版本
1 Setup
下载安装包:http://nodejs.cn/download/
Linux x86_64 下 node-xx-linux-x64.tar.gz
comcat@jackslab:/work/nodejs$ sudo tar --strip-components 1 -zxf node-v0.12.7-linux-x64.tar.gz -C /usr/local/ comcat@jackslab:/work/nodejs$ node -v v0.12.7
2 Try
comcat@jackslab:/work/nodejs$ npm install coap-cli -g
coap-cli@0.3.0 node_modules/coap-cli
├── commander@2.0.0
├── through2@0.4.2 (xtend@2.1.2, readable-stream@1.0.33)
└── coap@0.5.4 (lru-cache@2.5.2, coap-packet@0.1.12, backoff@2.3.0, bl@0.6.0)
comcat@jackslab:/work/nodejs$ coap
Usage: coap [command] [options] url
Commands:
get performs a GET request
put performs a PUT request
post performs a POST request
delete performs a DELETE request
Options:
-h, --help output usage information
-V, --version output the version number
-o, --observe Observe the given resource
-n, --no-new-line No new line at the end of the stream
-p, --payload <payload> The payload for POST and PUT requests
-q, --quiet Do not print status codes of received packets
comcat@jackslab:/work/nodejs$ coap get coap://vs0.inf.ethz.ch/
(2.05) ************************************************************
CoA
3 libcoap
#$ git clone git://git.code.sf.net/p/libcoap/code libcoap-code $ git clone git://github.com/obgm/libcoap.git libcoap-code $ cd libcoap-code $ ./autogen.sh $