An open API service indexing awesome lists of open source software.

https://github.com/lemon-mint/envaddr

Get Listen Address From env
https://github.com/lemon-mint/envaddr

Last synced: 3 months ago
JSON representation

Get Listen Address From env

Awesome Lists containing this project

README

        

# envaddr
Get Listen Address From env

``` shell
go get -u github.com/lemon-mint/envaddr
```

``` go
func Get(defaultAddr string) string
```

This function attempts to get the address from the environment variables `PORT`, `HOST` and `IP`.

If none of these are set, it returns the default address.