# startFront **Repository Path**: bsxbl/start-front ## Basic Information - **Project Name**: startFront - **Description**: springboot做了个简易版前端项目启动器 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-17 - **Last Updated**: 2023-05-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 简易前端项目启动器 项目实践过程中常用到nginx,但由于客户现场无外网,或者使用的服务器经常各种原因nginx安装失败。 但java环境的保障性还算高,于是用springboot做了个简易版前端项目启动器。由于使用springboot,所以支持大量的spring内置变量 # 实现说明 1. 实现了支持前端history模式 2. 简易的反向代理,目前支持一个 3. 支持指定要启动的前端目录(利用springboot内置属性) 4. 指定特定启动端口(利用springboot内置属性) 5. 入口文件仅支持名称 `index.html` 请自行修改 # 例子 ```shell script java -jar startfrontend-0.0.1.jar --server.port=8081 --spring.resources.staticLocations=file:D:\front\dist --useProxy=true --proxy.path="/api/*" --proxy.target=http://127.0.0.1:9999/api ``` - `--server.port` 指定端口 - `--spring.resources.staticLocations` 指定目录,需要file:开头,springboot的内置格式 - `--useProxy` 布尔值,是否使用代理,默认是`false` - `--proxy.path` 要代理的本地地址规则 - `--proxy.target` 代理目标地址