0
http://localhost:4101/endpoint/field
にリクエストすると、常にendpoint/:id
が記録されます。HTTPエンドポイントは呼び出されていません。
endpoint/field
はなぜ記録されませんか?
私は:id
がパスパラメータであり何でも構いませんが、私は明示的にfield
を別の方法で処理する必要があると認識しています。
'use strict';
var express = require('express');
var app = express();
var PORT = 4101;
app.route('/endpoint/:id')
.get(function(req, res) {
console.log('endpoint/:id');
});
app.route('/endpoint/field')
.get(function(req, res) {
console.log('endpoint/field');
});
app.listen(PORT, function(err) {
if (err) {
console.log('err on startup ' + err);
return;
}
console.log('Server listening on port ' + PORT);
});