Skip to content
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

Placeholders don't work with express 4 #62

Closed
dhaub opened this issue Jun 20, 2014 · 3 comments
Closed

Placeholders don't work with express 4 #62

dhaub opened this issue Jun 20, 2014 · 3 comments

Comments

@dhaub
Copy link

dhaub commented Jun 20, 2014

The bases and middleware are all placed at the end of express pipeline in version 4. This appears to be because the pipeline has been moved from the application variable "stack" to be part of the application's _router object.

References to server.stack in the util.js file need to be changed to server._router.task when working with express 4.

@dhaub dhaub closed this as completed Jun 20, 2014
@ericclemmons
Copy link
Owner

I'm... confused?

@dhaub
Copy link
Author

dhaub commented Jun 20, 2014

I was working on an express 4 application and my bases were not being
inserted where I had put the "staticPlaceholders" function in the
processing pipeline ("stack"). They were defaulting to the end of the
pipeline, which is what it does when there are no placeholders. I debugged
the application and found that references to "server.stack" in lib/util.js
were always empty. I guessed that express had moved the pipeline. I found
it in server._router.stack.

Modifying the code to look for the stack in this new location fixed the
problem. I've send you a pull request with my suggested fix.

Unfortunately, the tests don't seem to work on my machine, so I was unable
to add any new tests to test this functionality, other than it works with
my express application. I'm using express version 4.4.3

Thanks for writing this module. It's been extremely helpful.

On Fri, Jun 20, 2014 at 5:01 PM, Eric Clemmons notifications@github.com
wrote:

I'm... confused?


Reply to this email directly or view it on GitHub
#62 (comment)
.

@dhaub
Copy link
Author

dhaub commented Jun 21, 2014

Sorry, Eric, I posted this issue to the wrong project - it was for
grunt-express not grunt-express-server.

On Fri, Jun 20, 2014 at 5:16 PM, David Haubenstricker david@haubs.net
wrote:

I was working on an express 4 application and my bases were not being
inserted where I had put the "staticPlaceholders" function in the
processing pipeline ("stack"). They were defaulting to the end of the
pipeline, which is what it does when there are no placeholders. I debugged
the application and found that references to "server.stack" in lib/util.js
were always empty. I guessed that express had moved the pipeline. I found
it in server._router.stack.

Modifying the code to look for the stack in this new location fixed the
problem. I've send you a pull request with my suggested fix.

Unfortunately, the tests don't seem to work on my machine, so I was unable
to add any new tests to test this functionality, other than it works with
my express application. I'm using express version 4.4.3

Thanks for writing this module. It's been extremely helpful.

On Fri, Jun 20, 2014 at 5:01 PM, Eric Clemmons notifications@github.com
wrote:

I'm... confused?


Reply to this email directly or view it on GitHub
#62 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants