some changes

Signed-off-by: Odyssey <odyssey346@disroot.org>
This commit is contained in:
Odyssey
2023-01-07 17:44:25 +01:00
parent b1034bca16
commit de809e2837
5 changed files with 30 additions and 15 deletions

11
main.go
View File

@@ -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
}