我有一个用react native expo创建的前端,后端是使用spring boot完成的,当我在本地运行spring boot并在浏览器中键入URL时,该模型位于google cloud中(不部署'localhost URL'),它显示浏览器上的数据。如何在不部署Google云的情况下将这些数据发送到我的本机应用程序。
fetch('http://{your IP}:8081/')
.then((response) => response.json())
.then((responseJson) => {
this.setState({ message : responseJson.message.data })
})
.catch((error) => {
console.error(error);
});
现在我们有了命令提示符,让您键入
ipconfig
,然后按Enter键并在IPv4地址下获取数字。此号码是您的本地IP。