We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e908ad commit 9538573Copy full SHA for 9538573
1 file changed
main.go
@@ -2,6 +2,8 @@ package main
2
3
import (
4
"FileServerFiber/logic"
5
+ "flag"
6
+ "fmt"
7
8
"github.com/gofiber/fiber/v2"
9
"github.com/gofiber/fiber/v2/middleware/recover"
@@ -10,6 +12,8 @@ import (
10
12
11
13
func main() {
14
15
+ port := flag.Int("p", 4000, "启动端口")
16
+ flag.Parse()
17
engine := html.New("./tmpl", ".html")
18
19
app := fiber.New(fiber.Config{
@@ -22,6 +26,6 @@ func main() {
22
26
23
27
app.Get("/*", logic.Tmpl)
24
28
25
- app.Listen(":9512")
29
+ app.Listen(fmt.Sprintf(":%d", *port))
30
31
}
0 commit comments