load port from environment

This commit is contained in:
jc 2024-02-24 23:51:15 -05:00
commit 3b6f07f094
No known key found for this signature in database

View file

@ -1,6 +1,7 @@
package main package main
import ( import (
"fmt"
"html/template" "html/template"
"io" "io"
"log" "log"
@ -42,7 +43,12 @@ func main() {
e.GET("/", pages.Index) e.GET("/", pages.Index)
e.Logger.Fatal(e.Start(":5173")) port := os.Getenv("PORT")
if port != "" {
port = "5713"
}
e.Logger.Fatal(e.Start(fmt.Sprintf(":%s", port)))
} }
func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error { func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error {