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

Add setup callback #26

Closed
wants to merge 1 commit into from
Closed

Conversation

joefiorini
Copy link

This will allow Grunt users to further configure their applications beyond
just middleware, including mounting applications at specific endpoints.

This will allow Grunt users to further configure their applications
beyond just middleware, including mounting applications at specific
endpoints.
@joefiorini
Copy link
Author

According to @sidwood (thanks) on #16, I can do this same thing in the middleware callback by doing:

middleware: function(connect, options){
  return [
    connect().use("/styles/styles.css", sass.serve(options.base + "/../styles/styles.scss")),
    connect.static(options.base),
    connect.directory(options.base)
  ];
},

Now that I've seen it, it makes sense, but I did not realize that connect().use(...) returns middleware. I'm not sure if this plugin should depend on users having that kind of in-depth knowledge of connect. I think this PR makes it much clearer what I need to do to access the functionality I need. If we don't want to merge this, then maybe I could at least update the README to show an example of this?

@sindresorhus
Copy link
Member

Ya, would accept a readme PR ;)

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

Successfully merging this pull request may close these issues.

None yet

2 participants