25 lines
496 B
Bash
Executable File
25 lines
496 B
Bash
Executable File
#!/bin/bash
|
||
cd "$(dirname "$0")"
|
||
echo "[DMP] 正在启动系统..."
|
||
|
||
if ! command -v node &> /dev/null
|
||
then
|
||
echo "[ERROR] 未找到 Node.js,请从 https://nodejs.org 安装"
|
||
exit
|
||
fi
|
||
|
||
if [ ! -d "node_modules" ]; then
|
||
echo "[DMP] 正在安装依赖..."
|
||
npm install
|
||
fi
|
||
|
||
if [ ! -f "dmp_onion.db" ]; then
|
||
echo "[DMP] 正在初始化演示数据库..."
|
||
node db/seed.js
|
||
node db/seed_openai.js
|
||
fi
|
||
|
||
echo "[DMP] 启动服务器..."
|
||
open "http://localhost:3456"
|
||
node server.js
|