gruntjs / grunt-contrib-connect

Start a static web server.
http://gruntjs.com
MIT License
714 stars 146 forks source link

connect.static gone since 0.11, replaced with serveStatic #205

Closed zeripath closed 8 years ago

zeripath commented 8 years ago

Hi!

Thanks so much for your code. I'm just updating an old project and have been upgrading my dependencies in turn. I've noticed that since 0.11 and the update to connect 3 the syntax for delivering static content has changed. I wonder if it would be possible for you to include a bit of information in your changelog on this change to warn users, and if possible either link to some information on how to update our Gruntfiles or add some information. I will continue looking at my code and will update this issue with my findings.

zeripath commented 8 years ago

OK, so it appears very simple:

At the top of your Gruntfile.js you need to add:

var serveStatic = require('serve-static');

Then wherever connect.static is used you simply replace:

connect.static(...)

with:

serveStatic(...)

Or at least that appears to be it.

vladikoff commented 8 years ago

We updated the docs with this, feel free to PR mode doc updates if needed