Change default API URL from localhost to 127.0.0.1 (#153)

* Change host from localhost to 127.0.0.1

* change unit tests to also use 127.0.0.1 instead of localhost
This commit is contained in:
Seif Lotfy سيف لطفي
2016-10-13 00:00:53 +02:00
committed by C Cirello
parent 1ff480561a
commit 006c01c97e
4 changed files with 13 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ func testRouter() *gin.Engine {
}
func routerRequest(t *testing.T, router *gin.Engine, method, path string, body io.Reader) (*http.Request, *httptest.ResponseRecorder) {
req, err := http.NewRequest(method, "http://localhost:8080"+path, body)
req, err := http.NewRequest(method, "http://127.0.0.1:8080"+path, body)
if err != nil {
t.Fatalf("Test: Could not create %s request to %s: %v", method, path, err)
}
@@ -50,7 +50,7 @@ func routerRequest(t *testing.T, router *gin.Engine, method, path string, body i
}
func newRouterRequest(t *testing.T, method, path string, body io.Reader) (*http.Request, *httptest.ResponseRecorder) {
req, err := http.NewRequest(method, "http://localhost:8080"+path, body)
req, err := http.NewRequest(method, "http://127.0.0.1:8080"+path, body)
if err != nil {
t.Fatalf("Test: Could not create %s request to %s: %v", method, path, err)
}