Fiber Golang webdev tutorial serving SendString tutorial # 1

Fiber Golang webdev tutorial serving SendString tutorial # 1

 

 

// let create our first project in fiber/Golang
package main
import "github.com/gofiber/fiber/v2"
func main() {
    // create new router/server
    app := fiber.New() // install fiber first
    // lets create our first route
    app.Get("/", func(c *fiber.Ctx) error {
        // lets send string to users
        return c.SendString("Hello world!")
    })
    // lets speficiy port to run our serve
    app.Listen(":8080") // our server is complete.
    // lets run it..
    // only 3 lines of code
}

Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: