We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const http = require('http'); const router = require('find-my-way')(); router.on('OPTIONS', '/*', (req, res, params) => { res.end('{"hello": "world"}'); }); router.on('OPTIONS', '/obj/*', (req, res, params) => { res.end('{"hello": "wildcard"}'); }); router.on('GET', '/obj/:id', (req, res, params) => { res.end('{"hello": "paramtric"}'); }); const server = http.createServer((req, res) => { router.lookup(req, res); }); server.listen(3000, err => { if (err) throw err; console.log('Server listening on: http://localhost:3000'); // test const req = http.request({ host: 'localhost', port: 3000, method: 'OPTIONS', path: '/obj/params' }, res => { const chunks = []; res.on('data', chunk => chunks.push(chunk)); res.on('end', () => { const data = Buffer.concat(chunks).toString(); console.log(data); // result string }); }); req.end(); });
As I expect,the result data should be {"hello": "wildcard"}.
data
{"hello": "wildcard"}
Actually, it is {"hello": "world"}.
{"hello": "world"}
It seems something wrong with Node.prototype.{findChild, findVersionChild}:
Node.prototype.{findChild, findVersionChild}
child = this.children[':'] || this.children['*']
The text was updated successfully, but these errors were encountered:
Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Sorry, something went wrong.
fix delvedor#151 Wildcard route should not be blocked by Parametric w…
abb7e81
…ith different method
b7320d0
fix #151 Wildcard route should not be blocked by Parametric with diff… (
b4cb4f5
#152)
Successfully merging a pull request may close this issue.
As I expect,the result
data
should be{"hello": "wildcard"}
.Actually, it is
{"hello": "world"}
.It seems something wrong with
Node.prototype.{findChild, findVersionChild}
:The text was updated successfully, but these errors were encountered: