您当前的位置:易学堂 > 日志记录

Springboot实现内网访问的ip和端口号自定义

时间:2022-05-21 10:47:57

1.背景

内网联调:后端写api接口,前端调用

2.springboot配置

这是我的配置文件主要是server配置,设置为true的那个主要用于内网访问。index.html是我自定义的一个web界面(不用管)

server:
port: 7**7
address: 192.168.**.*
spring:
resources:
static-locations: classpath:/index.html
mvc:
hiddenmethod:
filter:
enabled: true
file:
uploadWindow: c:/myFile/
uploadLinux:/usr/gdm/model 

3.设置ip注意事项

我试了一下。这个ip不能肆无忌惮自定义,在电脑上输入win+R -> cmd -> ipconfig/all 这里所有的ipv4的地址都可以设置ip,端口号呢就随意定义

这样设置,启动成功…

postman也连通了…

web界面也通了 

标签: SpringBoot