つまるところ、これをやってみます。 http://socket.io/get-started/chat/ モチベーション Webで調べると割とExpress3系+Socket.io 0.9系の記事が多いイメージです。 Express4とSocket.io1は前バージョンと大分違う造りになっているので、そろそろExpress4系+Socket.io1系を試して記録しておこうと思いました。 環境 express 4.10.4 socket.io 1.2.1 モジュール用意 $ mkdir myapp $ cd myapp $ npm init $ npm i --save express $ npm i --save socket.io
Express application generator Use the application generator tool, express-generator, to quickly create an application skeleton. You can run the application generator with the npx command (available in Node.js 8.2.0). $ npx express-generator For earlier Node versions, install the application generator as a global npm package and then launch it: $ npm install -g express-generator $ express Display t
Installation curl: $ curl -# http://expressjs.com/install.sh | sh npm: $ npm install express git clone, first update the submodules: $ git submodule update --init $ make install $ make install-support Creating An Application The express.Server now inherits from http.Server, however follows the same idiom by providing express.createServer() as shown below. This means that you can utilize Express se
追記 11/7/31 Socket.IO v0.7 解説を最初に途中までで出す。 11/8/1 だいたい全部新機能なので '(新機能)' って書くのやめた。 11/8/4 オプションの設定周りを追記 11/8/6 認証周りを追記 11/8/12 スタンドアローンのサンプルを追記 11/9/27 Socket.IO v0.8 対応について追記 11/9/27 タイトルを Socket.IO API 解説に変更 11/9/27 翻訳サイトリンク追加 公式マニュアル翻訳サイト そういえば公式サイトの翻訳をフォークしたリポジトリで、それなりの更新頻度でやってます。 リポジトリの wiki も地味に訳しててこっちは結構役に立ちます。本記事と合わせてどうぞ。 本家 http://socket.io/ 翻訳ページ http://jxck.github.com/socket.io wiki https:/
2012.3.13追記 現在の最新版で動作するようエントリを修正しました。 2011.5.25追記 現在の最新版で動作するようエントリを修正しました。 はじめに このエントリでは、node.js向けフレームワークであるexpressを使ってアプリケーションのひな形を作成する手順について書いています。 Express - node web framework OSとソフトウェアのバージョン Mac OS X Lion 10.7.3 node.js v0.6.12 npm 1.1.6 express 2.5.8 expressのインストール expressをインストールする前に、npmをインストールします。 curl http://npmjs.org/install.sh | sudo shnpmをインストールしたあとで、npmコマンドでexpressフレームワークをインストールします。このと
expressにモジュールがある。 #!/usr/bin/env node var basicAuth = require('express').basicAuth; var app = require('express').createServer(); // 全てのアクセスに対してBasic認証をかける app.all('/', basicAuth(function(user, pass) { return 'admin' == user && 'express' == pass; })); app.all('/*', basicAuth(function(user, pass) { return 'admin' == user && 'express' == pass; })); app.get('/', function(req, res) { res.send('hello wo
node.jsは注目されている新技術であると同時にマニュアルやエラー例が少ないので、 先行技術を利用するが故にはまったこと、トピックス的なことをかきためる。 expressなんて「ソース読めって言ってんのか!」みたいなマニュアルしかないし。 バージョンは暫く0.4.7を利用。バージョンアップがかかれば最新をおっかけていく。 相対パスの取得がうまくいかない ソース: [javascript] require(“src/util”) [/javascript] エラー: [shell] node.js:134 throw e; // process.nextTick error, or ‘error’ event on first tick ^ Error: Cannot find module ‘src/util’ at Function._resolveFilename
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く