Skip to content

Commit

Permalink
Update App.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
paulq1984 committed Nov 9, 2024
1 parent 8605938 commit cb88aa8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import CurrentView from './Views/CurrentView';
import HourlyView from './Views/HourlyView';
import DailyView from './Views/DailyView';

const currentWeatherURL = `http://localhost:8080/currentWeather`;
const forecastDailyURL = `http://localhost:8080/forecastDaily`;
const forecastHourlyURL = `http://localhost:8080/forecastHourly`;
const location = `lat=51.32&long=0.88`

const currentWeatherURL = `http://localhost:8080/currentWeather?`;
const forecastDailyURL = `http://localhost:8080/forecastDaily?`;
const forecastHourlyURL = `http://localhost:8080/forecastHourly?`;

function App() {
const [currentWeather, setCurrentWeather] = useState(null);
Expand All @@ -21,7 +23,7 @@ function App() {
const urls = [currentWeatherURL, forecastDailyURL, forecastHourlyURL]

Promise.all(urls.map(url =>
fetch(url).then(res => res.json())
fetch(url + location).then(res => res.json())
))
.then((data) => {
console.log(data)
Expand Down

0 comments on commit cb88aa8

Please sign in to comment.