Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
python3.12-node22-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazy-template
python3.12-node22-template
Commits
8c4f5702
Commit
8c4f5702
authored
Sep 16, 2025
by
bin.gong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Makefile
parent
334d1b51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
Makefile
Makefile
+13
-7
No files found.
Makefile
View file @
8c4f5702
...
@@ -3,7 +3,7 @@ APP_NAME = python-node-demo
...
@@ -3,7 +3,7 @@ APP_NAME = python-node-demo
NODE
=
node
NODE
=
node
NPM
=
npm
NPM
=
npm
PYTHON
=
python3
PYTHON
=
python3
PIP
=
pip3
UV
=
uv
BACKEND_PORT
=
$
(
or
$(APP_PORT_1)
,8000
)
BACKEND_PORT
=
$
(
or
$(APP_PORT_1)
,8000
)
FRONTEND_PORT
=
$
(
or
$(APP_PORT_2)
,8001
)
FRONTEND_PORT
=
$
(
or
$(APP_PORT_2)
,8001
)
RESOURCE_PATH
=
$
(
abspath
$
(
dir
$
(
lastword
$(MAKEFILE_LIST)
)))
/.resource/resource_dev.json
RESOURCE_PATH
=
$
(
abspath
$
(
dir
$
(
lastword
$(MAKEFILE_LIST)
)))
/.resource/resource_dev.json
...
@@ -18,14 +18,20 @@ FRONTEND_PID_FILE = $(abspath $(dir $(lastword $(MAKEFILE_LIST))))/.logs/fronten
...
@@ -18,14 +18,20 @@ FRONTEND_PID_FILE = $(abspath $(dir $(lastword $(MAKEFILE_LIST))))/.logs/fronten
install
:
install
:
@
echo
"检查 Python 版本..."
@
echo
"检查 Python 版本..."
@
$(PYTHON)
--version
@
$(PYTHON)
--version
@
echo
"检查 pip 版本..."
@
echo
"检查 uv 是否已安装..."
@
$(PIP)
--version
@
if
!
command
-v
$(UV)
>
/dev/null 2>&1
;
then
\
echo
"❌ 错误:uv 未安装,请先安装 uv"
;
\
echo
"安装命令:curl -LsSf https://astral.sh/uv/install.sh | sh"
;
\
exit
1
;
\
fi
@
echo
"✅ uv 已安装"
@
echo
"检查 Node.js 版本..."
@
echo
"检查 Node.js 版本..."
@
$(NODE)
--version
@
$(NODE)
--version
@
echo
"检查 npm 版本..."
@
echo
"检查 npm 版本..."
@
$(NPM)
--version
@
$(NPM)
--version
@
echo
"正在安装Python依赖..."
@
echo
"正在使用 uv 安装Python依赖..."
@
cd
backend
&&
$(PIP)
install
-r
requirements.txt
@
cd
backend
&&
$(UV)
venv .venv
--force
@
cd
backend
&&
$(UV)
pip
install
-r
requirements.txt
-i
https://mirrors.aliyun.com/pypi/simple/
@
echo
"正在安装Node.js依赖..."
@
echo
"正在安装Node.js依赖..."
@
cd
frontend
&&
$(NPM)
install
@
cd
frontend
&&
$(NPM)
install
@
echo
"✅ 依赖安装完成"
@
echo
"✅ 依赖安装完成"
...
@@ -34,7 +40,7 @@ install:
...
@@ -34,7 +40,7 @@ install:
.PHONY
:
run-backend
.PHONY
:
run-backend
run-backend
:
run-backend
:
@
echo
"正在启动Python后端服务..."
@
echo
"正在启动Python后端服务..."
@
cd
backend
&&
BACKEND_PORT
=
$(BACKEND_PORT)
$(
PYTHON)
app.py
>
$(LOG_FILE_BACKEND)
2>&1 &
echo
$$
!
>
$(BACKEND_PID_FILE)
@
cd
backend
&&
BACKEND_PORT
=
$(BACKEND_PORT)
$(
UV)
run python
app.py
>
$(LOG_FILE_BACKEND)
2>&1 &
echo
$$
!
>
$(BACKEND_PID_FILE)
@
echo
"✅ Python后端已启动,端口:
$(BACKEND_PORT)
"
@
echo
"✅ Python后端已启动,端口:
$(BACKEND_PORT)
"
# 运行前端
# 运行前端
...
@@ -106,7 +112,7 @@ clean:
...
@@ -106,7 +112,7 @@ clean:
dev
:
dev
:
@
echo
"启动开发模式..."
@
echo
"启动开发模式..."
@
cd
frontend
&&
BACKEND_URL
=
http://localhost:
$(BACKEND_PORT)
APP_PORT_1
=
$(FRONTEND_PORT)
npx nodemon server.js &
@
cd
frontend
&&
BACKEND_URL
=
http://localhost:
$(BACKEND_PORT)
APP_PORT_1
=
$(FRONTEND_PORT)
npx nodemon server.js &
@
cd
backend
&&
BACKEND_PORT
=
$(BACKEND_PORT)
$(
PYTHON)
app.py &
@
cd
backend
&&
BACKEND_PORT
=
$(BACKEND_PORT)
$(
UV)
run python
app.py &
@
echo
"✅ 开发模式已启动"
@
echo
"✅ 开发模式已启动"
@
echo
"前端地址: http://localhost:
$(FRONTEND_PORT)
"
@
echo
"前端地址: http://localhost:
$(FRONTEND_PORT)
"
@
echo
"后端API地址: http://localhost:
$(BACKEND_PORT)
"
@
echo
"后端API地址: http://localhost:
$(BACKEND_PORT)
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment