Skip to content

Commit d775650

Browse files
feat: added seenode recipe for go
- Added go.mod and go.sum - Created main.go with a simple Fiber application - Added README.md with setup instructions and deployment guidelines for Seenode.
1 parent 4ae1b9e commit d775650

File tree

4 files changed

+155
-0
lines changed

4 files changed

+155
-0
lines changed

seenode/README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Seenode
3+
keywords: [seenode, deploy, cloud]
4+
description: Deploying to Seenode cloud platform.
5+
---
6+
7+
# Seenode Deployment Example
8+
9+
[![Github](https://img.shields.io/static/v1?label=&message=Github&color=2ea44f&style=for-the-badge&logo=github)](https://github.com/gofiber/recipes/tree/master/seenode) [![StackBlitz](https://img.shields.io/static/v1?label=&message=StackBlitz&color=2ea44f&style=for-the-badge&logo=StackBlitz)](https://stackblitz.com/github/gofiber/recipes/tree/master/seenode)
10+
11+
This project demonstrates how to deploy a Go application using the Fiber framework on Seenode.
12+
13+
## Prerequisites
14+
15+
Ensure you have the following installed:
16+
17+
- Golang
18+
- [Fiber](https://github.com/gofiber/fiber) package
19+
- [Seenode account](https://cloud.seenode.com)
20+
21+
## Setup
22+
23+
1. Clone the repository:
24+
```sh
25+
git clone https://github.com/gofiber/recipes.git
26+
cd recipes/seenode
27+
```
28+
29+
2. Install dependencies:
30+
```sh
31+
go get
32+
```
33+
34+
3. Create a Seenode account and connect your repository:
35+
- Go to [Seenode Dashboard](https://cloud.seenode.com)
36+
- Create a new Web Service
37+
- Connect your Git repository
38+
39+
4. Configure deployment:
40+
- **Build Command**: `go build -o app main.go`
41+
- **Start Command**: `./app`
42+
43+
5. Deploy the application:
44+
```sh
45+
git add .
46+
git commit -m "Deploy to Seenode"
47+
git push
48+
```
49+
50+
## Running the Application
51+
52+
1. Open the application in your browser using the provided Seenode URL.
53+
54+
## Example
55+
56+
Here is an example `main.go` file for the Fiber application:
57+
58+
```go
59+
package main
60+
61+
import (
62+
"fmt"
63+
"os"
64+
"github.com/gofiber/fiber/v2"
65+
)
66+
67+
func main() {
68+
app := fiber.New()
69+
70+
app.Get("/", func(c *fiber.Ctx) error {
71+
return c.SendString("Hello, Welcome to seenode 👋")
72+
})
73+
74+
port := os.Getenv("PORT")
75+
if port == "" {
76+
port = "80"
77+
}
78+
79+
app.Listen(fmt.Sprintf(":%s", port))
80+
}
81+
```
82+
83+
## References
84+
85+
- [Fiber Documentation](https://docs.gofiber.io)
86+
- [Seenode Documentation](https://seenode.com/docs/frameworks/go/fiber/)
87+
- [Seenode Dashboard](https://cloud.seenode.com)

seenode/go.mod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module seenode-example
2+
3+
go 1.23
4+
5+
require github.com/gofiber/fiber/v2 v2.52.9
6+
7+
require (
8+
github.com/andybalholm/brotli v1.1.0 // indirect
9+
github.com/google/uuid v1.6.0 // indirect
10+
github.com/klauspost/compress v1.17.9 // indirect
11+
github.com/mattn/go-colorable v0.1.13 // indirect
12+
github.com/mattn/go-isatty v0.0.20 // indirect
13+
github.com/mattn/go-runewidth v0.0.16 // indirect
14+
github.com/rivo/uniseg v0.2.0 // indirect
15+
github.com/valyala/bytebufferpool v1.0.0 // indirect
16+
github.com/valyala/fasthttp v1.51.0 // indirect
17+
github.com/valyala/tcplisten v1.0.0 // indirect
18+
golang.org/x/sys v0.28.0 // indirect
19+
)

seenode/go.sum

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
2+
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
3+
github.com/gofiber/fiber/v2 v2.52.9 h1:YjKl5DOiyP3j0mO61u3NTmK7or8GzzWzCFzkboyP5cw=
4+
github.com/gofiber/fiber/v2 v2.52.9/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw=
5+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
6+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
7+
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
8+
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
9+
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
10+
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
11+
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
12+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
13+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
14+
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
15+
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
16+
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
17+
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
18+
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
19+
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
20+
github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA=
21+
github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g=
22+
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
23+
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
24+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
25+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
26+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
27+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

seenode/main.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"github.com/gofiber/fiber/v2"
7+
)
8+
9+
func main() {
10+
app := fiber.New()
11+
12+
app.Get("/", func(c *fiber.Ctx) error {
13+
return c.SendString("Hello, Welcome to seenode 👋")
14+
})
15+
16+
port := os.Getenv("PORT")
17+
if port == "" {
18+
port = "80"
19+
}
20+
21+
app.Listen(fmt.Sprintf(":%s", port))
22+
}

0 commit comments

Comments
 (0)