Seenode Deployment Example
This project demonstrates how to deploy a Go application using the Fiber framework on Seenode.
Prerequisites
Ensure you have the following installed:
- Golang
- Fiber package
- Seenode account
Setup
-
Clone the repository:
git clone https://github.com/gofiber/recipes.git
cd recipes/seenode -
Install dependencies:
go mod tidy -
Create a Seenode account and connect your repository:
- Go to Seenode Dashboard
- Create a new Web Service
- Connect your Git repository
-
Configure deployment:
- Build Command:
go build -o app main.go - Start Command:
./app
- Build Command:
-
Deploy the application:
git add .
git commit -m "Deploy to Seenode"
git push
Running the Application
- 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)
}
}