Skip to content

Commit 4997557

Browse files
dylanhittEwenQuim
authored andcommitted
docs: remove usage of WithPort from docs in favor of WithAddr
1 parent 7197cba commit 4997557

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

documentation/docs/guides/options.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import "github.com/go-fuego/fuego"
1111

1212
func main() {
1313
s := fuego.NewServer(
14-
fuego.WithPort(8080),
14+
fuego.WithAddr("localhost:8080"),
1515
fuego.WithOpenAPIConfig(fuego.OpenAPIConfig{
1616
DisableSwagger : true,
1717
}),
@@ -27,7 +27,19 @@ func main() {
2727

2828
## Some options
2929

30-
### Port
30+
### Address
31+
32+
You can change the address of the server with the `WithAddr` option.
33+
34+
```go
35+
s := fuego.NewServer(
36+
fuego.WithAddr("localhost:8080"),
37+
)
38+
```
39+
40+
### Port (Deprecated)
41+
42+
**Deprecated** in favor of `WithAddr` shown above.
3143

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

examples/full-app-gourmet/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"flag"
5+
"fmt"
56
"log/slog"
67
"os"
78

@@ -69,7 +70,7 @@ func main() {
6970
Views: viewsRessources,
7071
}
7172

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

7475
// Run the server!
7576
err = app.Run()

0 commit comments

Comments
 (0)