subspacecommunity / subspace

A fork of the simple WireGuard VPN server GUI community maintained
MIT License
1.8k stars 131 forks source link

Docs: Document how to do local Web Dev for this project #110

Closed jack1902 closed 4 years ago

jack1902 commented 4 years ago

Is your feature request related to a problem? Please describe. Doing local dev was painful until i learned about --debug with go-bindata

Describe the solution you'd like We should add a new makefile command called debug or something similar which can be used to develope locally. something similar too:

develope: clean ## Build the binary with live changes to templates
    @echo "Creating live bindata.go..."
    @go run github.com/kevinburke/go-bindata/go-bindata --debug -o cmd/subspace/bindata.go --prefix "web/" --pkg main web/...
    @echo "+++ bindata.go created"

    @echo "Compiling subspace..."
    @CGO_ENABLED=0 \
        go build -v --compiler gc --ldflags "-extldflags -static -s -w -X main.version=${BUILD_VERSION}" -o subspace ./cmd/subspace \
            && rm cmd/subspace/bindata.go
    @echo "+++ subspace compiled"

Then you can run subspace locally with changes to templates live in your browser (this is possible with Docker but requires mounting as a volume ./web/:/src/web/ into the container for this trick to work

Describe alternatives you've considered Constantly build the bindata.go which is not fun

jack1902 commented 4 years ago

@agonbar you might find this one interesting for local development for this project :)