Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUX-624/ Changed Default port #61

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading