сборка сервера фронта в бинарник

This commit is contained in:
Artem Tsyrulnikov
2026-03-25 12:16:57 +03:00
parent 045cb4232a
commit 99920fca56
4 changed files with 111 additions and 0 deletions

19
build.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
echo "=== Building frontend ==="
npm run build
echo "=== Copying dist to server/ ==="
rm -rf server/dist
cp -r dist server/dist
echo "=== Building Go binary ==="
cd server
go mod init protoc-frontend-server 2>/dev/null || true
GOOS=windows GOARCH=amd64 go build -o ../protoc-frontend.exe .
echo ""
echo "=== Done! ==="
echo "Binary: protoc-frontend.exe"
echo "Usage: protoc-frontend.exe [-port 1111] [-api http://localhost:8000]"