fix: add missing cmd/server/main.go and fix .gitignore
The .gitignore pattern "server" was matching cmd/server/ directory, preventing main.go from being tracked. Anchored binary patterns to repo root with leading slash.
This commit is contained in:
24
cmd/server/main.go
Normal file
24
cmd/server/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"mgit.msbls.de/m/patholo/internal/handlers"
|
||||
)
|
||||
|
||||
func main() {
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "8080"
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
handlers.Register(mux)
|
||||
|
||||
log.Printf("patholo server starting on :%s", port)
|
||||
if err := http.ListenAndServe(":"+port, mux); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user