Skip to content
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.

Add support for router root specification. #20

Merged
merged 3 commits into from
Feb 12, 2014
Merged

Add support for router root specification. #20

merged 3 commits into from
Feb 12, 2014

Conversation

totherik
Copy link
Member

Currently, if someone chooses to use enrouten with a particular root path, routes will not resolve correctly.

This PR adds support for specifying a base route when using this module.

app.use('/foo', enrouten({ /*... */ }));

and effectively is the same to doing

app.use('/foo', app.router);

@pvenkatakrishnan
Copy link
Member

👍 Looks good.

@grawk
Copy link
Member

grawk commented Feb 12, 2014

It may be worthwhile to add a test case to enrouten to verify that when invoked with a root path app.use("/root", enrouten({})), any scanned routes ("/root/route1") aren't also available at "/route1".

The code changes look good otherwise.

@totherik
Copy link
Member Author

@grawk PR updated to reflect test case.

jasisk added a commit that referenced this pull request Feb 12, 2014
Add support for router root specification.
@jasisk jasisk merged commit 3d34c26 into master Feb 12, 2014
@totherik totherik deleted the root branch February 12, 2014 17:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants