-
Notifications
You must be signed in to change notification settings - Fork 486
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
Server-side: Route '/post' doesn't mount #91
Comments
@donkeyhot Can you provide some sample usage which shows this issue? |
@indexzero var flatiron = require('flatiron')
, app = flatiron.app;
app.use(flatiron.plugins.http);
app.router.get('/', function() {
this.res.text('Index get');
});
app.router.post('/', function() {
this.res.text('Index post');
});
app.router.get('/post/', function() {
this.res.text('Post get');
});
app.listen(3000); |
I've hit this same behavior when attempting to make a similar combination. My particular problem was with |
Hmm ... this is indeed a bug. Not quite sure how to disambiguate these in the router table. |
Upon further inspection, I'm starting to consider this a feature. Having this restriction allows for easier introspection of the routing table itself, as you can easily distinguish between what is a route name versus a verb. This shouldn't be changed unless there is a major refactor of the internal routing table that allows for bindable metadata on routes. |
@Marak Yeah, it would take a complete overhaul of the internal data structure to disambiguate the metadata from verbs and also from other partial-paths in the routing table. Worth considering, but never-the-less a lot of work. |
Route "/post" and it's derivatives like "/post/:id" doesn't mount, if post method for front page is already binded.
This happens after "isArray" check at router.js:579.
The text was updated successfully, but these errors were encountered: