scottcorgan / pushstate-server

Static file server that works with HTML5 Pushstate.
421 stars 35 forks source link

Change reported host from localhost to :: #35

Closed ldct closed 7 years ago

ldct commented 8 years ago

pushstate-server and the cli seem to listen to all hosts (:: in ipv6) instead of just localhost. The cli tells the user that it is listening only on localhost, which is inaccurate.

I ran into this while trying out create-react-app's deployment workflow, which suggests using pushstate-server.

scottcorgan commented 8 years ago

That's a very good change to make.

How about something more dynamic like:

// ...

let server = app.listen(port, function (err) {
  onStarted(err, server.address().address))
})

return server

which will give you something like:

{ "address": "::", "family": "IPv6", "port": 9000 }
ldct commented 8 years ago

@scottcorgan you're suggesting to change the signature of the _onStarted callback argument to start, do you consider that to be public API, since it's exported (https://github.com/scottcorgan/pushstate-server/blob/master/index.js#L14)?

scottcorgan commented 8 years ago

Ya. I'm ok with a breaking change.

btipling commented 7 years ago

Maybe consider making that a separate PR and merge this one since this is just updating what is printed on the cli?