1.8 KiB
Development
Screego requires:
- Go 1.15+
- Node 13.x
- Yarn 9+
Setup
Clone Repository
Clone screego/server source from git:
$ git clone https://github.com/screego/server.git && cd server
GOPATH
If you are in GOPATH, enable go modules explicitly:
$ export GO111MODULE=on
Download Dependencies:
# Server
$ go mod download
# UI
$ (cd ui && yarn install)
Start / Linting
Backend
Create a file named screego.config.development.local inside the screego folder with the content:
SCREEGO_EXTERNAL_IP=YOURIP
and replace YOURIP with your external ip.
Start the server in development mode.
$ go run . serve
The backend is available on http://localhost:5050
?> When accessing localhost:5050 it is normal that there are panics with no such file or directory.
The UI will be started separately.
Frontend
Start the UI development server.
Commands must be executed inside the ui directory.
$ yarn start
Open http://localhost:3000 inside your favorite browser.
Lint
Screego uses golangci-lint for linting.
After installation you can check the source code with:
$ golangci-lint run
Build
-
Build the UI
$ (cd ui && yarn build) -
Generate static assets for go.
Run packr (embeds static assets in go binaries)
$ go run hack/packr/packr.go -
Build the binary
CGO_ENABLED=0 go build \ -ldflags '-s -w -X main.version=`git describe --tags HEAD` -X main.mode=Prod' \ -buildmode=pie -trimpath -tags 'netgo osusergo' main.go