The FE for this experimental application is built with Go & GopherJS. GopherJS generates JavaScript from Go code and outputs it in the /scripts
directory.
- Go 1.18
- GopherJs installed
go install github.com/gopherjs/[email protected]
The FE requires the URL for the backend. This should be exported as:
$ export BACKEND_URL=XXX
Once this is exported, run make generatescripts
for the frontend app to compile.
Run make buildfrontend
. This command will create the runnable frontend.exe
in the project root directory.
Run make runfrontend
. This command will build the frontend and then immediately execute it.
Once changes to the /frontend/scripts/scripts.go
are made, the JS files will need to be regenerated. Run make generatescripts
to generate these.
Ensure that your variables are exported as detailed in Environment variables.
$ cd frontend
$ docker build -f Dockerfile -t frontend --build-arg BACKEND_URL=$BACKEND_URL .
$ docker run -dt -p 4321:4321/tcp frontend
NOTE: Use
--platform linux/amd64
in the docker build command when pushing to Azure.