You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analysiscode/src/start_server.bat

79 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

@echo off
chcp 65001
echo ==========================================
echo FortifyCode 代码检查系统启动脚本
echo ==========================================
echo.
echo 正在检查 Node.js 环境...
where node >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo [错误] 未找到 Node.js请先安装 Node.js
pause
exit /b 1
)
echo Node.js 版本:
node --version
echo.
echo 正在检查 Python 环境...
where python >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo [错误] 未找到 Python请先安装 Python
pause
exit /b 1
)
echo Python 版本:
python --version
echo.
echo 正在检查依赖包...
if not exist "node_modules" (
echo [提示] 首次运行,正在安装 Node.js 依赖...
call npm install
if %ERRORLEVEL% NEQ 0 (
echo [错误] 依赖安装失败
pause
exit /b 1
)
)
echo.
echo 正在检查 Python 代码检查工具...
python -m pylint --version >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo [警告] pylint 未安装,正在安装...
pip install pylint
)
python -m flake8 --version >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo [警告] flake8 未安装,正在安装...
pip install flake8
)
python -m bandit --version >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo [警告] bandit 未安装,正在安装...
pip install bandit
)
echo.
echo ==========================================
echo 启动服务器...
echo ==========================================
echo.
echo 服务器将在以下地址运行:
echo - 前端界面: http://localhost:5000
echo - API接口: http://localhost:5000/api
echo.
echo 按 Ctrl+C 停止服务器
echo.
node backend.js
pause