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:
$(MAKE) generate
go build -o knowyt src/knowyt.go
cd src/ && CGO_ENABLED=0 go build -o ../knowyt knowyt.go
run:
go run src/knowyt.go
$(MAKE) build
./knowyt
run-loop:
pexec -R -c -e TARGET \

View File

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

View File

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