Initial changes testing and running vue3
This commit is contained in:
1 parent
68f71c9d6c
commit
9f37d3faf1
68 files changed
+23452
-12
No files matched your search
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Local dev: API server + v2client (Vue 3 / Vite).
|
||||
# Run from inside nix-shell, which provides node/pnpm/pm2/mariadb,
|
||||
# starts the local MySQL, and exports DB_* and JSON_KEY.
|
||||
#
|
||||
# Unlike startDevServerAndClient.sh (remote dev box, /home/mab/ss, Vue 2
|
||||
# client) this is path-relative and points at v2client-vite-vue3.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$REPO"
|
||||
|
||||
if [ -z "${JSON_KEY:-}" ]; then
|
||||
echo "JSON_KEY is not set -- run this from inside nix-shell." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! mysqladmin --socket="$REPO/.mysql/mysql.sock" ping &>/dev/null; then
|
||||
echo "Local MySQL is not running -- run this from inside nix-shell." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo '::--:: Starting API server (:3000) + socket.io (:3001) under pm2...'
|
||||
cd "$REPO/server"
|
||||
# `env -u name`: nix's mkShell exports its `name` attr ("Solid Scribe Env")
|
||||
# as $name, and pm2 uses $name to override the app name from ecosystem.config.js.
|
||||
pm2 delete NoteServer &>/dev/null || true
|
||||
pm2 flush &>/dev/null || true
|
||||
env -u name pm2 start ecosystem.config.js
|
||||
cd "$REPO"
|
||||
|
||||
echo '::--:: Starting v2client dev server -> http://localhost:5173'
|
||||
cd "$REPO/v2client-vite-vue3"
|
||||
[ -d node_modules ] || pnpm install
|
||||
screen -S "V2ClientScreen" -X quit &>/dev/null || true
|
||||
screen -dmS "V2ClientScreen" bash -c "cd '$REPO/v2client-vite-vue3'; pnpm dev"
|
||||
|
||||
cat <<MSG
|
||||
|
||||
::--:: Up.
|
||||
client http://localhost:5173 (proxies /api -> :3000, /socket -> :3001)
|
||||
api http://localhost:3000
|
||||
|
||||
logs pm2 logs NoteServer
|
||||
screen -r V2ClientScreen (detach: ctrl-a d)
|
||||
stop pm2 delete NoteServer; screen -S V2ClientScreen -X quit
|
||||
MSG
|
||||
Reference in new issue
Block a user