Skip to content

Commit

Permalink
fix connect static bug and add default root fix #49
Browse files Browse the repository at this point in the history
  • Loading branch information
avevlad committed Apr 6, 2014
1 parent 5bdb37a commit 652d6fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-connect",
"version": "2.0.3",
"version": "2.0.4",
"description": "Gulp plugin to run a webserver (with LiveReload)",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"event-stream": "~3.1.0",
"connect-livereload": "~0.3.2",
"tiny-lr": "0.0.5",
"connect": "~2.14.3"
"connect": "^2.14.3"
},
"devDependencies": {
"gulp": "~3.5.1",
Expand Down
5 changes: 4 additions & 1 deletion src/index.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
path = require("path")
es = require("event-stream")
util = require("gulp-util")
http = require("http")
Expand All @@ -11,7 +12,7 @@ class ConnectApp
constructor: (options) ->
opt = options
opt.port = opt.port || "8080"
opt.root = opt.root || __dirname
opt.root = opt.root || path.dirname(module.parent.id)
opt.host = opt.host || "localhost"
@oldMethod("open") if opt.open
@server()
Expand All @@ -38,6 +39,8 @@ class ConnectApp
if typeof opt.root == "object"
opt.root.forEach (path) ->
middleware.push connect.static(path)
else
middleware.push connect.static(opt.root)
return middleware

log: (@text) ->
Expand Down

0 comments on commit 652d6fe

Please # to comment.