无法从其他设备访问Spring服务器

时间:2019-12-23 18:08:45

标签: java spring spring-boot networking

我有一个网站,该网站具有后端并显示主题列表。后端用Spring编写,H2作为数据库。数据库保存在我PC上的文件中。

这是我的application.properties

spring.datasource.url=jdbc:h2:file:C:/Projects/database/dbname
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true
spring.h2.console.path=/h2console

当我从承载Spring服务器的PC上访问网站时,主题列表加载得很好,并且一切正常,但是当我尝试从LAN中的其他设备访问该站点时,出现错误Chrome控制台:GET net:ERR_CONNECTION-REFUSED

,还有:Uncaught (in promise) Error: Network error

0 个答案:

没有答案
相关问题