diff --git a/demos/scripts/build-reactapp.bat b/demos/scripts/build-reactapp.bat new file mode 100644 index 0000000..51199f8 --- /dev/null +++ b/demos/scripts/build-reactapp.bat @@ -0,0 +1,22 @@ +rem ------------------------------------------------- +rem The script is use to package JavaWebApp +rem Env: Nodejs 8.x +rem ------------------------------------------------- + +@echo off + +rem 删除 dist 目录 +cd ../reactapp + +echo ">>>> 1. Delete node_modules" +rd /s /q node_modules + +echo ">>>> 2. npm install" +rem 安装本地依赖 +call npm install + +echo ">>>> 3. npm run prod" +rem 构建生产环境,构建的静态资源文件在 dist 目录 +call npm run prod + +pause diff --git a/demos/scripts/demo04-start.bat b/demos/scripts/demo04-start.bat new file mode 100644 index 0000000..ab8d672 --- /dev/null +++ b/demos/scripts/demo04-start.bat @@ -0,0 +1,17 @@ +rem ----------------------------------------------------------------------------- +rem Demo04 - 动静分离 +rem 1. 启动 Nginx +rem 2. 启动一个 JavaApp,访问地址分别为: +rem localhost:9040 +rem ----------------------------------------------------------------------------- +@echo off +echo ">>>> 1. Start nginx" +cd "../nginx-1.14.0" +call nginx-start.bat + +echo ">>>> 2. Start 3 java app: localhost:9040" +cd "../javaapp" +start /min java -Dtomcat.connector.port=9040 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main +pause + +