Scorpiion / vane

Server-side framework for Dart/Dartlang with a built-in middleware system.
BSD 3-Clause "New" or "Revised" License
59 stars 11 forks source link

Binding address from Env #20

Closed andreasolund closed 9 years ago

andreasolund commented 9 years ago

Vane doesn't support specifying the binding address since it's hard coded to 127.0.0.1 in serve.dart#L37. I propose that we add the ADDRESS environment variable and change the default address to InternetAddress.LOOPBACK_IP_V4.

Basically something like this:

var addressEnv = Platform.environment['ADDRESS'];
var address = addressEnv == null ? InternetAddress.LOOPBACK_IP_V4 : addressEnv;
Scorpiion commented 9 years ago

Now "0.0.0.0" is the default address, the address can also be set either via an optional parameter to serve() or as an environment variable. Same goes for port.

Fixed in commit 85849b281d4fc7d9c632ef157b44c2264f9e5b59.

andreasolund commented 9 years ago

:+1: