ufront / ufront-mvc

The core MVC framework that powers ufront
MIT License
17 stars 15 forks source link

Serving on localhost with different hostname #60

Closed vrescobar closed 8 years ago

vrescobar commented 8 years ago

Hello,

I just followed the HelloWorld tutorial until I decided to test it by using the default neko server.

By my surprise when starting a neko server, it started a server using my hostname name at the default port, but it wasn't visible until I changed my local hostname to "localhost".

$ haxelib run ufront server
# Switching directory to www
# Starting Neko Server on newhope:2987

For sure I could fix it by adding an entry in /etc/hosts pointing to 127.0.0.1, but couldn't just the default server use 127.0.0.1 instead? By using other programs to serve from local filesystem never has such issue.

kevinresol commented 8 years ago

This is because ufront calls Host.localhost().toString() to get the host name. And that is neko's matter about returning non-"localhost" values.

You can specify the host name explicitly: ufront server --host localhost