I have a Go API I am trying to test and I've installed reflex. It gets up and running just fine, but every time I save my project it creates a new instance of the application. It will prompt my system to ask for permissions:
Do you want the application “go-api” to accept incoming network connections?
Clicking Deny may limit the application’s behavior.
This setting can be changed in the Firewall pane of Security & Privacy preferences.
Would really appreciate any help or even some guidance on how to troubleshoot as I haven't seen anything about this bug yet.
When I check my Mac's privacy and security settings, I can see that the firewall allows an instance of go-api along with many other instances of go-api.
When I reveal these applications in my finder I can see that Go is instantiating separate build files for each instance of my program and creating a Unix executable file to serve as the application.
On my coworker's devices that have installed Go and reflex for the same API, this behavior is not present. I do not think it is related to the reflex config or the API because theirs are exactly the same as mine is, but not exhibiting the same behavior.
I am thinking that this may be related to my .bash_profile or something:
# Setting PATH for Go
export GOPATH="$HOME/go"
PATH="$GOPATH/bin:$PATH"
export GOOGLE_APPLICATION_CREDENTIALS=/Users/me/Documents/path/to/go-api
export GO_ENV=dev
use
r.Run("localhost:8080")
instead of
r.Run(":8080")
bind your go server to listen to localhost instead of any host and that will fix your issue on localhost. Be advised that it can effect your deployment so tread with care if using production code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With