feat: setup project router

This commit is contained in:
Guz
2024-10-07 15:39:46 -03:00
parent 9cd1e1b1e9
commit bb0c4b371a
7 changed files with 152 additions and 0 deletions

29
cmd/serve/main.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"flag"
"os"
"strconv"
comicverse "forge.capytal.company/capytalcode/project-comicverse"
)
var port *int
func init() {
portEnv := os.Getenv("COMICVERSE_PORT")
if portEnv == "" {
portEnv = "8080"
}
p, err := strconv.Atoi(portEnv)
if err != nil {
p = 8080
}
port = flag.Int("port", p, "The port to the server to listen on")
}
func main() {
flag.Parse()
comicverse.Run(*port)
}