Skip to content

Commit

Permalink
Some fixes and updates to readme and docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Suhaibinator committed Oct 13, 2024
1 parent 008b855 commit 4d164b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@ To run SMQ, execute the built binary:
./smq
```

SMQ will start running on port 80097 by default. However, you can customize the behavior of SMQ using command-line flags and environment variables. The priority for these settings is as follows: command-line flags > environment variables > default values.
SMQ will start running on port 8097 by default. However, you can customize the behavior of SMQ using command-line flags and environment variables. The priority for these settings is as follows: command-line flags > environment variables > default values.

### Using Docker

```bash
docker run suhaibinator/smq:latest
```

### Command-Line Flags

- `--dbpath`: Specifies the path to the SQLite database file. By default, it is set to `/db/dbtest.db`.
- `--port`: Specifies the port to listen on. By default, it is set to `80097`.
- `--dbpath`: Specifies the path to the SQLite database file. By default, it is set to `./dbtest.db`.
- `--port`: Specifies the port to listen on. By default, it is set to `8097`.

If command-line flags are provided, they take the highest priority and override any other settings.

Expand Down Expand Up @@ -84,7 +90,7 @@ import (

func main() {
// Create a new client
smqClient, err := client.NewClient("localhost", "80097")
smqClient, err := client.NewClient("localhost", "8097")
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ const (

var (
// DBPath is the path to the SQLite database file
DBPath = "/db/dbtest.db"
Port = "80097"
DBPath = "./dbtest.db"
Port = "8097"
)
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"

"github.com/Suhaibinator/SuhaibMessageQueue/config"
"github.com/Suhaibinator/SuhaibMessageQueue/server"
)

func init() {
Expand Down Expand Up @@ -35,4 +36,7 @@ func init() {
}

func main() {
// Start the server
server := server.NewServer(config.Port, config.DBPath)
server.Start()
}

0 comments on commit 4d164b6

Please sign in to comment.