要するに、私が訪問したときにどのようst
に奉仕することができますか?index.html
/
Express でst モジュールを使用しています (または Connect は関係ありません)。これが私のコード全体です:
var st = require('st');
var path = require('path');
var connect = require('connect');
var app = connect();
app.use(st({
url: '/',
path: path.resolve(__dirname, 'public'),
index: 'index.html', // !!! PROBLEM LINE !!!
cache: false,
passthrough: true
}));
app.use(function(req, res) {
res.end('This is not served from the st module.');
});
app.listen(8000, function() { console.log('App started.'); });
にアクセスするlocalhost:8000/index.html
と、ファイルが表示されます。にアクセスすると、インデックス HTML が表示されlocalhost:8000/
ません。
index
オプションとして次のことを試しましたが、うまくいきませんでした。
index: false
index: true
index: 'index.html'
index: 'public/index.html'
index: path.resolve(__dirname, 'public/index.html')
を訪問したときにst
奉仕するにはどうすればよいですか?index.html
/