File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
documentation/docs/guides
examples/full-app-gourmet Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import "github.com/go-fuego/fuego"
11
11
12
12
func main () {
13
13
s := fuego.NewServer (
14
- fuego.WithPort ( 8080 ),
14
+ fuego.WithAddr ( " localhost: 8080" ),
15
15
fuego.WithOpenAPIConfig (fuego.OpenAPIConfig {
16
16
DisableSwagger : true ,
17
17
}),
@@ -27,7 +27,19 @@ func main() {
27
27
28
28
## Some options
29
29
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.
31
43
32
44
You can change the port of the server with the ` WithPort ` option.
33
45
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"flag"
5
+ "fmt"
5
6
"log/slog"
6
7
"os"
7
8
@@ -69,7 +70,7 @@ func main() {
69
70
Views : viewsRessources ,
70
71
}
71
72
72
- app := rs .Setup (fuego .WithPort ( * port ))
73
+ app := rs .Setup (fuego .WithAddr ( fmt . Sprintf ( "localhost:%d" , * port ) ))
73
74
74
75
// Run the server!
75
76
err = app .Run ()
You can’t perform that action at this time.
0 commit comments