Athens: First log message always "Starting application at http://127.0.0.1:3000" despite config

Created on 13 Sep 2018  路  3Comments  路  Source: gomods/athens

Describe the bug
I was playing around with the configuration and changed the port of the proxy to 3002. Despite doing this I still got the "Starting application at http://127.0.0.1:3000" log message at the start. It turns out that no matter what the configuration is this message will always display. This occurs for both Olympus and proxy.

Looking into this further it appears to be because the buffalo option of Addr but not Host is not given.

    app := buffalo.New(buffalo.Options{
        Env: ENV,
        PreWares: []buffalo.PreWare{
            cors.Default().Handler,
        },
        SessionName: "_athens_session",
        Logger:      blggr,
        Addr:        conf.Proxy.Port,
    })

To Reproduce
Change the Port variable in the configuration file and start the server.

Expected behavior
I expected the log to be consistent with where the server actually binded to.

Environment (please complete the following information):

  • OS: darwin 64
  • Go version : 1.11
  • Buffalo Version : v0.12.4
  • Olympus or proxy version : commit 57b11e848969918f611db498592b7108a274ab00

Discussion
I can provide the PR fixing this but I was wondering how we should handle the "Host" buffalo option. Should it be an extra configuration? Or should something else be done?

bug proxy

All 3 comments

@zkry I think that the best thing is to use the "Host" buffalo option, and change the "Port" option to not have the : prefix.

@rchakra3 you did almost all of this config work, what do you think?

@arschles I agree that seems the best way to do it!

This to me sounds like a Buffalo bug rather than an Athens one.

The Go convention (in the std lib and others) is that you provide the Port as colon-prefixed string and so you can do http.ListenAndServe(":3000", nil).

So Buffalo should be able to handle this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arschles picture arschles  路  4Comments

marpio picture marpio  路  3Comments

leitzler picture leitzler  路  3Comments

marpio picture marpio  路  4Comments

marwan-at-work picture marwan-at-work  路  4Comments