Visual Studio 2012/2013向けのNode.js Toolsがリリースされました。現在、1.0 Alphaとなっており、正式リリースというわけでは無いようです。
プロジェクト作成
プロジェクトテンプーレトは、Javascript配下に存在します。テンプレートは6つ。
- Form Existing Node.js code
- Blank Node.js Console Application
- Blank Express Application
- Blank Windows Azure Node.js Application
- Blank Windows Azure Express Application
よくあるサンプルとして、Node.js Web Application を選択してみます。デフォルトのコードは以下の通り。
var http = require('http'); var port = process.env.port || 1337; http.createServer(function (req, res) { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello World\n'); }).listen(port);
プロジェクトは以下の通り。
普通に実行すると、IEが立ち上がりWebサーバーが実行できてきるのが確認できます。
ブレイクポイントも設定できます。設定後IEをリロードすれば、以下の通り。変数等も確認できるようです。
と、今日のところはここまで。