11
main.go
11
main.go
@@ -1,10 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/ProjectSegfault/publapi/pages"
|
||||
"github.com/ProjectSegfault/publapi/utils"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
@@ -36,3 +36,12 @@ func main() {
|
||||
|
||||
app.Listen(utils.GetPort())
|
||||
}
|
||||
|
||||
// GetPort returns the port to listen on
|
||||
func GetPort() string {
|
||||
port := os.Getenv("PUBLAPI_PORT")
|
||||
if port == "" {
|
||||
port = "3000"
|
||||
}
|
||||
return ":" + port
|
||||
}
|
||||
|
Reference in New Issue
Block a user