background preloader

Video Tutorials

Video Tutorials

Manual Stability: 3 - Stable To use the HTTP server and client one must require('http'). The HTTP interfaces in Node are designed to support many features of the protocol which have been traditionally difficult to use. In particular, large, possibly chunk-encoded, messages. The interface is careful to never buffer entire requests or responses--the user is able to stream data. HTTP message headers are represented by an object like this: Keys are lowercased. In order to support the full spectrum of possible HTTP applications, Node's HTTP API is very low-level. http.STATUS_CODES# A collection of all the standard HTTP response status codes, and the short description of each. http.createServer([requestListener])# Returns a new web server object. The requestListener is a function which is automatically added to the 'request' event. http.createClient([port], [host])# This function is deprecated; please use http.request() instead. Class: http.Server# This is an EventEmitter with the following events: Example: or

Installing Node.js and NPM on Ubuntu 11.04 In my last article I installed Node on Ubuntu 10.10. Nothing really has changed for Ubuntu 11.04 but I want to have a separate article since a lot of people hit my installing Node articles. Also, keep in mind you can customize your Node installation using these gists – just make sure to read all the comments on the bottom of that page for any changes as I know at least one path was wrong in one of the examples. Assuming a clean install of Ubuntu 11.04 with all the current updates, here are the commands you need to install the latest version of Node on Ubuntu 11.04: Something to keep in mind if you want to run a specific version of Node you can use Nave.

Code with Node: Learn by Doing Code w/ Node is a web developer course designed to teach you how to create production grade features for a robust web app using Node and Express JS. The course is also designed to help you become a self-sufficient developer who can solve problems on the fly while working through complex features. Overview:Elevate your developer skills in this learn by doing course where we will be building a feature rich, production ready, web application with the NEMO stack (Node Express MongoDB & Other stuff). In this course you will build a production ready RESTful CRUD application that has:- Bootstrap 4 theming- ES6 (and later) syntax- Maps with Mapbox- Geospatial indexing- Search- Filtering- Pagination- Image upload (single and multiple)- Mailers- Password reset Master key skills, including:- Debugging effectively with locus- Looking up solutions online- Problem solving on the fly This isn't your average run-of-the-mill follow along course. Are you ready to become a self-sufficient developer?

laverdet/node-fibers Express - API 가이드 문서 Express Node.js의 고성능, 고품격 웹 애플리케이션 개발 설치 $ npm install express 또는 전역 옵션을 사용하여 express(1)를 설치합니다: $ npm install -g express 역자주 - npm(node package manager)은 Node.JS에서 사용할 모듈을 설치하는 쉘 명령어입니다. 빠른 시작 Express를 시작하는 가장 쉬운 방법은 실행 가능한 express(1) 을 이용하여 애플리케이션 생성하는 것입니다: 애플리케이션 만들기: $ npm install -g express $ express /tmp/foo && cd /tmp/foo 종속성 모듈 설치: $ npm install -d 서버 시작: $ node app.js 역자주 - npm에 -g 옵션을 사용하여 전역에서 사용될 모듈로 설치하고 express 쉘 명령을 이용하는 것을 권장합니다. 서버 만들기 express.HTTPServer의 인스턴스를 생성하려면 createServer() 메서드를 호출합니다. var app = require('express').createServer(); app.get('/', function(req, res){ res.send('hello world'); }); app.listen(3000); HTTPS 서버 만들기 express.HTTPSServer의 초기화는 위의 일반적인 서버의 초기화와 거의 비슷하지만, 허용할 key와 cert 같은 옵션을 포함하는 개체를 전달하는 것이 다릅니다. 환경 설정 Express는 production과 development 모드를 지원합니다. 다음 예제에서는 development 모드에서만 오류 발생시의 스택을 추적하기 위한 설정으로 dumpExceptions옵션을 활성화하고 두 모드의 일반적인 설정으로 methodOverride와 bodyParser를 이용하고 있습니다. 유사한 방법으로 사용자가 임의로 설정한 문자열을 사용하여 여러가지 환경을 만들수 있습니다: $ NODE_ENV=production node app.js 세팅

Introduction to Node.js How To Use MySQL With Meteor ⚙ Co The problem with Meteor, for me, isn’t really with Meteor at all. It's with MongoDB, which is bundled with Meteor. I do like the fact that I don't need to change the schema when I make changes to the DB or the fact that I can insert arbitrary data and even create real objects without resorting to ORM. But all of this doesn't really compensate for the fact that MongoDB is so limited compared to modern SQL databases. There are quite a few things I found problematic--such as the absence of AUTOINCREMENT (and yes, I know about using uuids) and not having joins. Since Meteor is open source I figured I'll give a shot at trying to make it work with SQL and it ended up being a lot simpler than I expected. Features Limitations Client side the collection still use mongo syntax for find() All tables need to have a unique id Insert, Update and Delete operations on the client don't update the data locally. Implementation Approach Things This Project Needs Dror Matalon can be found on Github here.

node v0.2.6 한글 번역 v0.2.6 한글 번역 Synopsis 예제 : "Hello World"를 응답하는 Node 웹서버 이 서버를 구동하기 위해서 위 코드를 example.js에 쓰고 node 프로그램을 통해 실행시켜보자. > node example.js Server running at 이 문서에 있는 모든 예제들은 이와 유사하게 실행될 것이다. Standard Modules Node와 함께 컴파일되는 수많은 모듈들의 대부분이 아래 문서화 되어 있다. 예제: var sys = require('sys'); Node는 다른 모듈들과의 확장도 가능하다. Buffers 순수 자바스크립트는 유니코드와 비슷하지만, 이진데이타에는 좋지 않다. Raw data는 Buffer 클래스의 인스턴스에 저장이 된다. Buffer 객체는 전역이다. Buffer 에서 자바스크립트의 String 객체로 변환할 때는 explicit 인코딩 메소드가 필요하다. ascii - 7 bit 아스키 데이타에서만 사용된다. new Buffer(size) - size 옥텟만큼의 새로운 Buffer를 할당한다. new Buffer(array) - 옥텟들로 이루어진 하나의 배열만큼 새로운 buffer를 할당한다. new Buffer(str, encoding='utf8') - 주어진 str을 가지는 새로운 buffer를 할당한다. buffer.write(string, offset=0, encoding='utf8') - "string"을 주어진 encdoing을 사용하여 buffer에 쓴다. 예제 : utf8 스트링을 Buffer에 쓰고 프린트하기 buf = new Buffer(256); len = buf.write('\u00bd + \u00bc = \u00be', 0); console.log(len + " bytes: " + buf.toString('utf8', 0, len)); // 12 bytes: ½ + ¼ = ¾ 위의 buffer.write()를 보자. 예제 EventEmitter Streams Global Objects

maxogden/art-of-node: a short introduction to node.js