Skip to content

Commit

Permalink
test run on railway
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-streza committed Nov 29, 2022
1 parent c346ece commit 078f5c4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
29 changes: 29 additions & 0 deletions api/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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, World!",
})
})

app.Listen(getPort())
}
13 changes: 0 additions & 13 deletions api/server.go

This file was deleted.

0 comments on commit 078f5c4

Please sign in to comment.