Skip to content

Commit

Permalink
docs: remove usage of WithPort from docs in favor of WithAddr
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanhitt authored and EwenQuim committed Apr 5, 2024
1 parent 7197cba commit 4997557
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 14 additions & 2 deletions documentation/docs/guides/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "github.com/go-fuego/fuego"

func main() {
s := fuego.NewServer(
fuego.WithPort(8080),
fuego.WithAddr("localhost:8080"),
fuego.WithOpenAPIConfig(fuego.OpenAPIConfig{
DisableSwagger : true,
}),
Expand All @@ -27,7 +27,19 @@ func main() {

## Some options

### Port
### Address

You can change the address of the server with the `WithAddr` option.

```go
s := fuego.NewServer(
fuego.WithAddr("localhost:8080"),
)
```

### Port (Deprecated)

**Deprecated** in favor of `WithAddr` shown above.

You can change the port of the server with the `WithPort` option.

Expand Down
3 changes: 2 additions & 1 deletion examples/full-app-gourmet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"fmt"
"log/slog"
"os"

Expand Down Expand Up @@ -69,7 +70,7 @@ func main() {
Views: viewsRessources,
}

app := rs.Setup(fuego.WithPort(*port))
app := rs.Setup(fuego.WithAddr(fmt.Sprintf("localhost:%d", *port)))

// Run the server!
err = app.Run()
Expand Down

0 comments on commit 4997557

Please sign in to comment.