refactor: build static go binary
This commit is contained in:
parent
60039fc562
commit
5ba57ae81b
@ -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 \
|
||||||
|
@ -6,6 +6,6 @@ type ApplicationConfig struct {
|
|||||||
|
|
||||||
func NewApplicationConfig() ApplicationConfig {
|
func NewApplicationConfig() ApplicationConfig {
|
||||||
return ApplicationConfig{
|
return ApplicationConfig{
|
||||||
DataDir: "../data/",
|
DataDir: "data/",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user