feat: rename folders
This commit is contained in:
30
go-fiber/main.go
Normal file
30
go-fiber/main.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func getPort() string {
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = ":3000"
|
||||
} else {
|
||||
port = ":" + port
|
||||
}
|
||||
|
||||
return port
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := fiber.New()
|
||||
|
||||
app.Get("/", func(c *fiber.Ctx) error {
|
||||
return c.JSON(fiber.Map{
|
||||
"message": "Hello, Railway!",
|
||||
})
|
||||
})
|
||||
|
||||
app.Listen(getPort())
|
||||
}
|
||||
Reference in New Issue
Block a user