Connect Router Deprecation and Support for Express Mounting #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brian,
First of all thanks for making this library - it's awesome and takes care of so much heavy lifting with regards to working with OAuth providers. Nice job.
This pull request covers two changes that I'd love to see integrated at some stage:
1. Tweaks to deal with Connect Router being deprecated
I'm not sure if you've seen the discussion, but the connect router has been deprecated and now only exists in Express:
senchalabs/connect#262
While I found this surprising at first, I've moved over to using express rather than just connect which has been an extremely pleasant experience. I don't think I implemented the changes in the best way, but the changes do demonstrate what is required to interact with the express routing rather than connect (i.e. not much).
2. OAuth changes to support Express Application Mounting
A feature that I have found extremely useful in Express, is the ability to define a number of express applications independently and then mount them into a "master" application definition. It's a very effective way of modularizing and composing your applications.
The one trick is that the url of an application may change based on mounting it. For example, the example in the express repo shows mounting an example blog application into a blog subdirectory. The problem is that the OAuth callback urls are based only on the path set in the configuration and don't take into account the
app.route
value that is passed around when an application is mounted (and not). I've hacked the code to make it work as a proof of concept, and it definitely does the job, but you might know a more elegant way to implement this.Anyway, thanks again, and I'd love to see these changes make it in to the repo at some stage so I can blow away my fork :)
Cheers,
Damon.