Revert APIURL changes, it's impossible
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
450bf3631c
commit
a88651e4b7
|
@ -3,8 +3,8 @@ ARG APIURL
|
|||
WORKDIR /project
|
||||
ADD . /project/
|
||||
RUN go mod tidy
|
||||
RUN GOARCH=wasm GOOS=js go build -o web/app.wasm ./src
|
||||
RUN go build -o app ./src
|
||||
RUN GOARCH=wasm GOOS=js go build -o web/app.wasm -ldflags="-X 'main.ApiURL=$APIURL'" ./src
|
||||
RUN go build -o app -ldflags="-X 'main.ApiURL=$APIURL'" ./src
|
||||
|
||||
FROM alpine:latest AS staging
|
||||
RUN apk --no-cache add ca-certificates
|
||||
|
|
11
Makefile
11
Makefile
|
@ -1,10 +1,14 @@
|
|||
APIURL_prod := https://api.nicecock.eu/api
|
||||
APIURL_staging := https://api.nicecock.eu/api/testing
|
||||
APIURL_prod := https://api.quenten.nl/api
|
||||
APIURL_staging := https://api.quenten.nl/api/testing
|
||||
|
||||
build:
|
||||
GOARCH=wasm GOOS=js go build -o web/app.wasm -ldflags="-X 'main.ApiURL=${APIURL_staging}'" ./src
|
||||
go build -o app -ldflags="-X 'main.ApiURL=${APIURL_staging}'" ./src
|
||||
|
||||
build-new:
|
||||
GOARCH=wasm GOOS=js go build -o web/app.wasm ./src
|
||||
go build -o app ./src
|
||||
|
||||
build-prod:
|
||||
GOARCH=wasm GOOS=js go build -o web/app.wasm -ldflags="-X 'main.ApiURL=${APIURL_prod}'" ./src
|
||||
go build -o app -ldflags="-X 'main.ApiURL=${APIURL_prod}'" ./src
|
||||
|
@ -12,5 +16,8 @@ build-prod:
|
|||
run: build
|
||||
./app
|
||||
|
||||
run-new: build-new
|
||||
APIURL=${APIURL_staging} ./app
|
||||
|
||||
run-prod: build-prod
|
||||
./app
|
|
@ -10,6 +10,10 @@ import (
|
|||
"github.com/maxence-charriere/go-app/v9/pkg/app"
|
||||
)
|
||||
|
||||
var (
|
||||
ApiURL string
|
||||
)
|
||||
|
||||
type Homepage struct {
|
||||
app.Compo
|
||||
}
|
||||
|
|
10
src/main.go
10
src/main.go
|
@ -4,7 +4,6 @@ import (
|
|||
"compress/gzip"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/gorilla/handlers"
|
||||
"github.com/maxence-charriere/go-app/v9/pkg/app"
|
||||
|
@ -16,10 +15,6 @@ import (
|
|||
// collection *mongo.Collection
|
||||
//}
|
||||
|
||||
var (
|
||||
ApiURL string
|
||||
)
|
||||
|
||||
func main() {
|
||||
homepage := NewHomepage()
|
||||
aboutpage := NewAboutPage()
|
||||
|
@ -40,11 +35,6 @@ func main() {
|
|||
// It exits immediately on the server side
|
||||
app.RunWhenOnBrowser()
|
||||
|
||||
ApiURL = os.Getenv("APIURL")
|
||||
if ApiURL == "" {
|
||||
log.Fatalln("Unable to get API URL from environment variables!")
|
||||
}
|
||||
|
||||
icon := &app.Icon{
|
||||
Default: "/web/static/images/icon-small.png",
|
||||
Large: "/web/static/images/icon.png",
|
||||
|
|
Loading…
Reference in New Issue