我正在使用這個 Web 框架進行 Go:https ://github.com/gofiber/fiber我想運行他們給出的名為“hello world”的基本示例我復制了代碼并將其放在一個名為main.go// ?? Fiber is an Express inspired web framework written in Go with ??// ?? Github Repository: https://github.com/gofiber/fiber// ?? API Documentation: https://docs.gofiber.iopackage mainimport ( "log" "github.com/gofiber/fiber")func main() { // Fiber instance app := fiber.New() // Routes app.Get("/", hello) // Start server log.Fatal(app.Listen(3000))}// Handlerfunc hello(c *fiber.Ctx) { c.Send("Hello, World ??!")}在我運行腳本之前,我還確保使用go get -u github.com/gofiber/fiber.然后運行go run main.go文件運行但它不在我的本地主機上運行并告訴我它正在運行HOST[::]我怎樣才能讓它運行localhost而不是HOST[::]. 我試圖查看它是否在我的本地主機上,但它根本不存在。
Go Fiber 不在本地主機上運行
慕的地8271018
2022-06-13 17:30:33