From f42a3724feda95cdffc1cbe7602bf607515cb669 Mon Sep 17 00:00:00 2001 From: Wanda Gusdya Date: Sat, 7 Jan 2023 08:57:48 +0700 Subject: [PATCH] update alamat api --- src/components/DetailModal.js | 2 +- src/components/ForecastContent.js | 2 +- src/components/WeatherCard.js | 4 ++-- src/components/WeatherCardContent.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/DetailModal.js b/src/components/DetailModal.js index 13d6744..6586e8f 100644 --- a/src/components/DetailModal.js +++ b/src/components/DetailModal.js @@ -4,7 +4,7 @@ import moment from "moment"; function DetailModal(props) { const weather = props.weather - let url = `http://localhost:3001/images/${weather.summary.replaceAll(' ', '_')}.png` + let url = `http://157.245.192.125:3001/images/${weather.summary.replaceAll(' ', '_')}.png` let formattedDate = moment(weather.date).format("DD/MM/YYYY HH:mm:ss") let temperature = Math.round((weather.temperature + Number.EPSILON) * 100) / 100 let apparentTemperature = Math.round((weather.apparentTemperature + Number.EPSILON) * 100) / 100 diff --git a/src/components/ForecastContent.js b/src/components/ForecastContent.js index 7a3fc12..a4402b6 100644 --- a/src/components/ForecastContent.js +++ b/src/components/ForecastContent.js @@ -11,7 +11,7 @@ function ForecastContent(props) { if (props.forecast != null) { const forecast = props.forecast - let url = `http://localhost:3001/images/${forecast.summary.replaceAll(' ', '_')}.png` + let url = `http://157.245.192.125:3001/images/${forecast.summary.replaceAll(' ', '_')}.png` image = {forecast.summary} let temperature = Math.round((forecast.temperature + Number.EPSILON) * 100) / 100 header =

{temperature}℃

diff --git a/src/components/WeatherCard.js b/src/components/WeatherCard.js index 83455af..f9b6d59 100644 --- a/src/components/WeatherCard.js +++ b/src/components/WeatherCard.js @@ -15,7 +15,7 @@ class WeatherCard extends React.Component { }; } componentDidMount() { - fetch(`http://localhost:3001/api/v1/weather/latest/${this.state.device}`) + fetch(`http://157.245.192.125:3001/api/v1/weather/latest/${this.state.device}`) .then(res => res.json()) .then( (result) => { @@ -35,7 +35,7 @@ class WeatherCard extends React.Component { } ) - fetch(`http://localhost:3001/api/v1/weather/forecast/${this.state.device}`) + fetch(`http://157.245.192.125:3001/api/v1/weather/forecast/${this.state.device}`) .then(res => res.json()) .then( (result) => { diff --git a/src/components/WeatherCardContent.js b/src/components/WeatherCardContent.js index 20c606b..4c349a0 100644 --- a/src/components/WeatherCardContent.js +++ b/src/components/WeatherCardContent.js @@ -18,7 +18,7 @@ function WeatherCardContent(props) { if (props.weather != null) { const weather = props.weather device =

Device {weather.deviceId}

- let url = `http://localhost:3001/images/${weather.summary.replaceAll(' ', '_')}.png` + let url = `http://157.245.192.125:3001/images/${weather.summary.replaceAll(' ', '_')}.png` image = {weather.summary} let temperature = Math.round((weather.temperature + Number.EPSILON) * 100) / 100 header =

{temperature}℃