forked from pu8crm6xf/analysiscode
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.
|
|
3 months ago | |
|---|---|---|
| .. | ||
| API.md | 3 months ago | |
| README.md | 3 months ago | |
| backend.js | 3 months ago | |
| frontend.html | 3 months ago | |
| simple_test.html | 3 months ago | |
| test_refresh.html | 3 months ago | |
README.md
代码质量检查后端启动手册
前提条件
- Node.js 已安装(版本 >= 14)。
- Python 3.9 已安装,且bandit、flake8、pylint 通过pip安装。
- 依赖:express、multer、cors(运行
npm install express multer cors安装)。
启动步骤
-
导航到项目目录:
cd D:\软件工程\代码质量检查\src -
安装Node.js依赖(如果尚未):
npm install express multer cors -
启动后端服务器:
node view/backend.js- 控制台会显示“Server running on port 3000”。
- 服务器监听http://localhost:3000。
-
测试API:
- 使用curl示例或前端页面(如果有
view/frontend.html,通过浏览器打开并提交)。 - 示例:上传
test_sample.py,选择所有工具,检查响应JSON。
- 使用curl示例或前端页面(如果有
停止服务器
按Ctrl+C在终端中停止。
常见问题
- 如果端口3000被占用,修改
app.listen(3000)为其他端口(如5000)。 - CORS错误:确保cors已启用;如果从本地文件测试前端,使用Live Server扩展避免origin null。
- 工具失败:检查Python PATH(工具必须在系统PATH中可用)。