Skip to content

Commit

Permalink
reverts broken commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sintaxi committed Apr 5, 2016
1 parent 834a7d2 commit b0d5c58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 14 additions & 11 deletions bin/harp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,16 @@ program
.description("Start a Harp server in current directory")
.action(function(path, program){
var projectPath = nodePath.resolve(process.cwd(), path || "")
if(typeof program.ip == 'undefined') program.ip = '0.0.0.0'
if(typeof program.port == 'undefined') program.port = 9000
harp.server(projectPath, { ip: program.ip, port: program.port }, function(){
var host = this.address()
if(host.address == '0.0.0.0' || host.address == '127.0.0.1') host.address = 'localhost'
var hostUrl = "http://" + host.address + ":" + host.port + "/"
var ip = program.ip || '0.0.0.0'
var port = program.port || 9000
harp.server(projectPath, { ip: ip, port: port }, function(){
var address = ''
if(ip == '0.0.0.0' || ip == '127.0.0.1') {
address = 'localhost'
} else {
address = ip
}
var hostUrl = "http://" + address + ":" + port + "/"
output("Your server is listening at " + hostUrl)
})
})
Expand All @@ -99,13 +103,12 @@ program
.description("Start a Harp server to host a directory of Harp projects")
.action(function(path, program){
var projectPath = nodePath.resolve(process.cwd(), path || "")
if(typeof program.port == 'undefined') program.port = 9000
harp.multihost(projectPath, { port: program.port }, function(){
var host = this.address()
if(host.port == "80"){
var port = program.port || 9000
harp.multihost(projectPath, { port: port }, function(){
if(port == "80"){
var loc = "http://harp.nu"
}else{
var loc = "http://harp.nu:" + host.port
var loc = "http://harp.nu:" + port
}
output("Your server is hosting multiple projects at " + loc)
})
Expand Down
2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ exports.multihost = function(dirPath, options, callback){
app.use(middleware.process)
app.use(middleware.fallback)
app.listen(options.port || 9000, callback)

return app
}

/**
Expand Down

0 comments on commit b0d5c58

Please sign in to comment.