我们的程序是前后端分离的。
后端是springboot,在IDEA中启动GismapApplication.java,访问http://localhost:8080/history/geometry?category=prefpgn&start=-5000&end=-221,就能看到数据了。
前端是vue,cmd到vue-gismap下,npm run dev,访问http://localhost:8090/#/specialmap,就能看到页面了。
但是后端和前端的ip和port一样,不能在同一台主机中启动,所以要把前后端的端口号port设置成不同的,才能联调。
一、设置端口号
- 修改后端端口号
Springboot修改端口号;
D:\gismap\java\master\gismap\src\main\resources\application.yml
修改port即可,我把端口号由之前的8080,修改为了8081。
server:
port: 8081
#数据库配置
spring:
datasource:
#alibaba数据连接池
type: com.alibaba.druid.pool.DruidDataSource
#postgresql驱动
driverClassName: org.postgresql.Driver
#数据库地址、账号、密码
url: jdbc:postgresql://127.0.0.1:5432/postgres
username: postgres
password: 123456
druid:
#初始化连接大小
initial-size: 8
#