chore: initial import 萌邮 MengPost (React+Vite + Go+Gin)
Made-with: Cursor
This commit is contained in:
16
dev.sh
Normal file
16
dev.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# 一键启动本地开发: 后端 Go 和 前端 Vite. Ctrl-C 同时退出.
|
||||
set -e
|
||||
ROOT="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
cleanup() { kill 0 2>/dev/null || true; }
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
( cd "$ROOT/mengpost-backend" && go mod tidy && go run . ) &
|
||||
( cd "$ROOT/mengpost-frontend" && { [ -d node_modules ] || npm install; } && npm run dev ) &
|
||||
|
||||
echo ""
|
||||
echo " backend : http://127.0.0.1:8787"
|
||||
echo " frontend: http://127.0.0.1:5173"
|
||||
echo ""
|
||||
wait
|
||||
Reference in New Issue
Block a user