I am using this web framework for go: https://github.com/gofiber/fiber
I want to run the basic example they gave called "hello world"
I copied the code and put it in a file called 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.io
package main
import (
"log"
"github.com/gofiber/fiber"
)
func main() {
// Fiber instance
app := fiber.New()
// Routes
app.Get("/", hello)
// Start server
log.Fatal(app.Listen(3000))
}
// Handler
func hello(c *fiber.Ctx) {
c.Send("Hello, World !")
}
Before I ran the script I also made sure to install the framework by using go get -u github.com/gofiber/fiber
.
Then running go run main.go
the file runs but it doesn't run on my local host and tells me it is running on HOST[::]
How can I make it so it runs on localhost
rather than HOST[::]
. I tried to see if it was on my localhost and it is not there at all.