Hello World Example

April 30, 2026 ยท View on GitHub

Github StackBlitz

This project demonstrates a simple "Hello, World!" application using the Fiber framework in Go.

Prerequisites

Ensure you have the following installed:

Setup

  1. Clone the repository:

    git clone https://github.com/gofiber/recipes.git
    cd recipes/hello-world
    
  2. Install dependencies:

    go get
    

Running the Application

  1. Start the application:

    go run main.go
    
  2. Access the application at http://localhost:3000.

Example

Here is an example main.go file for the Fiber application:

package main

import (
    "log"

    "github.com/gofiber/fiber/v3"
)

func main() {
    // Fiber instance
    app := fiber.New()

    // Routes
    app.Get("/", hello)

    // Start server
    log.Fatal(app.Listen(":3000"))
}

// Handler
func hello(c fiber.Ctx) error {
    return c.SendString("Hello, World ๐Ÿ‘‹!")
}

References