Skip to content

Commit

Permalink
BUX-624/ Changed Default port (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: Wojciech Regulski <48433067+wregulski@users.noreply.github.com>
  • Loading branch information
Nazarii-4chain and wregulski authored Feb 29, 2024
1 parent d6e85c9 commit 2f185d5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ The `spv-wallet-web-backend` is an HTTP server that serves as the referential ba

### Endpoints documentation

For endpoints documentation you can visit swagger which is exposed on port 8080 by default.
For endpoints documentation you can visit swagger which is exposed on port 8180 by default.

```
http://localhost:8080/swagger/index.html
http://localhost:8180/swagger/index.html
```

## Contribution
Expand Down
2 changes: 1 addition & 1 deletion config/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (c *Config) WithDb() *Config {
func setHttpServerDefaults() {
viper.SetDefault(EnvHttpServerReadTimeout, 40)
viper.SetDefault(EnvHttpServerWriteTimeout, 40)
viper.SetDefault(EnvHttpServerPort, 8080)
viper.SetDefault(EnvHttpServerPort, 8180)
viper.SetDefault(EnvHttpServerCookieDomain, "localhost")
viper.SetDefault(EnvHttpServerCookieSecure, false)
viper.SetDefault(EnvHttpServerCorsAllowedDomains, []string{})
Expand Down
6 changes: 3 additions & 3 deletions release/README.DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ To run the `spv-wallet-web-backend` as a Docker image with custom configuration,
Here's the updated command with environment variables for the Docker container:

```bash
docker run -p 8080:8080 -e SPVWALLET_PAYMAIL_DOMAIN=example.com ${DOCKERHUB_OWNER}/${DOCKERHUB_REPO}:latest
docker run -p 8180:8180 -e SPVWALLET_PAYMAIL_DOMAIN=example.com ${DOCKERHUB_OWNER}/${DOCKERHUB_REPO}:latest
```

### Configuration

The `spv-wallet-web-backend` can be configured using environment variables. Here is a list of available environment variables and their purpose:

| Environment Variable | Description | Default Value |
| ---------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| ---------------------------------- | --------------------------------------------------------- |-------------------------------------------------------------------------------------------------------------------|
| `DB_HOST` | Database host address. | `localhost` |
| `DB_PORT` | Database port number. | `5432` |
| `DB_USER` | Database username. | `postgres` |
Expand All @@ -26,7 +26,7 @@ The `spv-wallet-web-backend` can be configured using environment variables. Here
| `DB_SSL_MODE` | Database SSL mode. | `disable` |
| `HTTP_SERVER_READ_TIMEOUT` | HTTP server read timeout (in seconds). | `40` |
| `HTTP_SERVER_WRITE_TIMEOUT` | HTTP server write timeout (in seconds). | `40` |
| `HTTP_SERVER_PORT` | HTTP server port. | `8080` |
| `HTTP_SERVER_PORT` | HTTP server port. | `8180` |
| `HTTP_SERVER_COOKIE_DOMAIN` | HTTP server cookie domain parameter. | `localhost` |
| `HTTP_SERVER_COOKIE_SECURE` | HTTP server cookie secure parameter. | `false` |
| `HTTP_SERVER_CORS_ALLOWED_DOMAINS` | HTTP server CORS origin allowed domains. | `[]` |
Expand Down
6 changes: 3 additions & 3 deletions transports/http/server/http_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestNewHttpServer(t *testing.T) {

testLogger := zerolog.Nop()

server := NewHttpServer(8080, &testLogger)
server := NewHttpServer(8180, &testLogger)
server.ApplyConfiguration(WithPanicEndpoint)

// Create a test request
Expand Down Expand Up @@ -60,7 +60,7 @@ func TestApplyConfiguration(t *testing.T) {
// Arrange
testLogger := zerolog.Nop()

server := NewHttpServer(8080, &testLogger)
server := NewHttpServer(8180, &testLogger)
require.NotNil(t, server, "Server should be created")

// Act
Expand All @@ -74,7 +74,7 @@ func TestShutdownWithContext(t *testing.T) {
// Arrange
testLogger := zerolog.Nop()

server := NewHttpServer(8080, &testLogger)
server := NewHttpServer(8180, &testLogger)
require.NotNil(t, server, "Server should be created")

// Act
Expand Down

0 comments on commit 2f185d5

Please sign in to comment.