node.jsとexpressでウェブサイトを作成しました。次に、サブディレクトリでnode.jsサーバーを使用するようにlighttpdを設定しました。
$HTTP["url"] =~ "^/app/" {
proxy.server = ( "" => ( (
"host" => "127.0.0.1",
"port" => 3000
) )
)
}
開くhttp://localhost/app/
と、次のようなものを書いたため、エラー404が発生します。
app.get('/', function (req, res){
res.render('index');
});
これらの行を次のように変更するより良い方法はありますか?
var relPath = '/app';
app.get(relPath + '/', function (req, res){
res.render('index');
});
?