-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
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
feat: route parameters #134
Conversation
I just noticed some strange behaviour in the output of Given # /routes/_id/index.js
export default async function (app, opts) {
app.get('/test', async function (req, reply) {
})
} Instead of showing:
it displays:
The application itself still functions as expected, e.g. app.get('/', async function (req, reply) {
}) Results in:
Not sure what to make of it! |
My advice would be make use of |
Thanks, I'll keep that in mind! I wasn't sure where to start logging, as the route is working properly, just not displaying correctly in the |
I added a new test to track this down. The route tree, at least on my system, looks like this:
But all of the tests pass as expected, so it appears to just be an issue in how the tree is being displayed. |
The code looks good to me. I would start trying to assemble the routes manually and see if you can reproduce the rendering problem. |
I believe I finally found the culprit! I created a PR here: (I'm not sure if github allows referencing between projects or not) |
…into route-parameters
The code looks ok! Could you add docs about it in the README.md? |
I updated the documentation and added CJS tests as well, should be good to go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* fix: add missing type routeParams related to #134 * test: add a test for routeParams option
Adds route parameters based on underscore-prefixed folders. See #133
Checklist
npm run test
andnpm run benchmark
and the Code of conduct