Awesome! I am thinking we need to provide 3 ways to inject in middleware for ripple:
- .ripple folder in the project's folder (containing a middleware directory that we can load the plugins) - a middleware folder in the ripple install dir (not sure if we can do this with npm) that will load for every project - Programatically for people who are using the ripple server as part of their existing express server. This may take a little refactoring of our server code to allow joining to an existing server component. On Tue, Oct 8, 2013 at 7:31 AM, Damon Oehlman <[email protected]> wrote: > Hey Guys, > > From memory I think I filed an ICLA previously, and yes I'm happy to pitch > in with the work that Gord is proposing also (which is slightly more > extensive than what is included in the existing PR). > > Cheers, > Damon. > > > > On Tue, Oct 8, 2013 at 9:41 PM, Christian Grobmeier <[email protected] > >wrote: > > > Although I don't not understand from Ripple as much as I wished, this > > looks like a great addition. Also I understood that this middleware yould > > maybe be used to mock server backend connections, right? I have exactly > > that use case that a guy who helps me in his prime time on my project > would > > prefer not to install the huge, real java server but just work with some > > json first. > > > > Damon mentioned he is willing to contribute his feature. If he would file > > an ICLA and donates we could take this commit directly. Furthermore I > see a > > good chance to welcome a new team member in a while. :-) > > > > > > On 8 Oct 2013, at 2:49, Gord Tanner wrote: > > > > We had a fork a little while ago that added the ability to have custom > >> middleware for the Ripple server [1]. > >> > >> Basically when adding path's to the ripple server it would detect the > >> presence of a ripple-middleware.js file and require and load it into the > >> express app. > >> > >> This is an amazing feature and would give us a lot of power for > >> integrating > >> in some third party plugins and extensions. > >> > >> I am thinking we should take inspiration from this commit and create a > >> middleware injection system for ripple. > >> > >> I would think we need to support global middleware (loaded for every > >> project) as well as project based middleware (loaded from a file in the > >> project folder, much like the pull request does now) > >> > >> Starting this thread to talk about high level design goals for this > >> feature > >> as well as debating if it is required. > >> > >> Usecases: > >> > >> - Custom route overrides > >> - Browserifying content > >> - Other fun stuff > >> - Simulating Lagging of content. This would be awesome! > >> > >> > >> > >> [1] - > >> https://github.com/**DamonOehlman/incubator-ripple/**commit/** > >> f35ae027c9c605983d63a2d8a741fc**148f804a77< > https://github.com/DamonOehlman/incubator-ripple/commit/f35ae027c9c605983d63a2d8a741fc148f804a77 > > > >> > > > > > > --- > > http://www.grobmeier.de > > @grobmeier > > GPG: 0xA5CC90DB > > >
