Skip to main content

Seenode Deployment Example

Github StackBlitz

This project demonstrates how to deploy a Go application using the Fiber framework on Seenode.

Prerequisites

Ensure you have the following installed:

Setup

  1. Clone the repository:

    git clone https://github.com/gofiber/recipes.git
    cd recipes/seenode
  2. Install dependencies:

    go mod tidy
  3. Create a Seenode account and connect your repository:

  4. Configure deployment:

    • Build Command: go build -o app main.go
    • Start Command: ./app
  5. Deploy the application:

    git add .
    git commit -m "Deploy to Seenode"
    git push

Running the Application

  1. Open the application in your browser using the provided Seenode URL.

Example

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

package main

import (
"fmt"
"log"
"os"
"github.com/gofiber/fiber/v3"
)

func main() {
app := fiber.New()

app.Get("/", func(c fiber.Ctx) error {
return c.SendString("Hello, Welcome to seenode 👋")
})

port := os.Getenv("PORT")
if port == "" {
port = "8080"
}

if err := app.Listen(fmt.Sprintf(":%s", port)); err != nil {
log.Fatalf("failed to start server: %v", err)
}
}

References