Spring-Boot 2 + Angular 6 + Ant Design 脚手架
mvn archetype:generate -Dfilter=com.luhuiguo.archetypes:spring-angular-antd-archetype
按提示输入,即可生成项目。
进入项目目录,输入
mvn spring-boot:run
即可运行,打开浏览器访问
http://localhost:8080
登录用户密码为 admin:admin 或 user:user
如果在开发过程中,需要启用live-reload,前后端可以分别启动
mvn spring-boot:run -Dskip.npm
启动后端
cd frontend
npm start
启动前端,然后通过
http://localhost:4200
访问前端页面,这时对前端页面的修改,会自动刷新浏览器页面。 前端通过 proxy.conf.json
{
"/api": {
"target": "http://localhost:8080",
"secure": false
},
"/actuator": {
"target": "http://localhost:8080",
"secure": false
},
"/webjars": {
"target": "http://localhost:8080",
"secure": false
},
"/v2/api-docs": {
"target": "http://localhost:8080",
"secure": false
}
}
把对应后台请求转到后端