Skip to content

Commit

Permalink
feat: allow define services with ip (#166)
Browse files Browse the repository at this point in the history
* feat: allows declare service with IPs

* bump version

* remove debugs

* fix tests
  • Loading branch information
cristianoliveira committed Jun 15, 2024
1 parent ff38392 commit 66e00b0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .ergo
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ two.domain http://localhost:8082
redislocal redis://localhost:6543
*.wildcard http://localhost:3030
withextraspace http://localhost:2222
127.0.0.1:3034 mysitewithip
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.1
v0.4.2
4 changes: 4 additions & 0 deletions proxy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ func readServicesFromFile(filepath string) ([]Service, error) {
name, urlWithPort = pair[0], pair[1]
}

if !strings.Contains(urlWithPort, "://") {
urlWithPort = "http://" + urlWithPort
}

service, err := NewService(name, urlWithPort)
if err != nil {
return nil, fmt.Errorf("invalid service format `%v`. %v`", line, err)
Expand Down
2 changes: 1 addition & 1 deletion proxy/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestWhenHasErgoFile(t *testing.T) {
})

t.Run("It loads the services redirections", func(t *testing.T) {
expected := 10
expected := 11
service := len(config.Services)

if expected != service {
Expand Down

0 comments on commit 66e00b0

Please sign in to comment.