refactor: build static go binary

This commit is contained in:
Settel 2022-03-03 10:16:50 +01:00
parent 60039fc562
commit 5ba57ae81b
3 changed files with 5 additions and 5 deletions

View File

@ -4,10 +4,11 @@ info:
build: build:
$(MAKE) generate $(MAKE) generate
go build -o knowyt src/knowyt.go cd src/ && CGO_ENABLED=0 go build -o ../knowyt knowyt.go
run: run:
go run src/knowyt.go $(MAKE) build
./knowyt
run-loop: run-loop:
pexec -R -c -e TARGET \ pexec -R -c -e TARGET \

View File

@ -6,6 +6,6 @@ type ApplicationConfig struct {
func NewApplicationConfig() ApplicationConfig { func NewApplicationConfig() ApplicationConfig {
return ApplicationConfig{ return ApplicationConfig{
DataDir: "../data/", DataDir: "data/",
} }
} }

View File

@ -2,7 +2,6 @@ package main
import ( import (
"fmt" "fmt"
"net/http"
"os" "os"
"sirlab.de/go/knowyt/application" "sirlab.de/go/knowyt/application"
"sirlab.de/go/knowyt/applicationConfig" "sirlab.de/go/knowyt/applicationConfig"
@ -38,7 +37,7 @@ func main() {
mux.PrivateHandleFunc("/api/removeQuote", app.RemoveQuote) mux.PrivateHandleFunc("/api/removeQuote", app.RemoveQuote)
// default handler // default handler
http.HandleFunc("/", handler.FileHandler) mux.PublicHandleFunc("/", handler.FileHandler)
// start listening // start listening
fmt.Printf("http://localhost:%d/\n", mux.Port) fmt.Printf("http://localhost:%d/\n", mux.Port)