ここを参考に。
http://net.tutsplus.com/tutorials/javascript-ajax/introduction-to-express/
静的リンクを持つindex.htmlを表示するまでの最小構成のHTTPサーバを書く。
index.html
<html> <head> <title>express</title> </head> <body> <h1>Hello, world!</h1> <img src="./image.jpg" /> </body> </html>
app.js
var express = require("express"); var app = express(); app.get("/",function(req,res){ res.sendfile("index.html"); }); app.use(express.static(__dirname)); app.listen(3000);
やっぱりnode.jsはコンパクトで便利だ。