Weathervenue는 Google지도와 OpenWeatherMap 데이터를 사용하는 날씨 웹 사이트입니다. 따뜻한 겨울 날씨 휴가 또는 시원한 여름 탈출.
다른 종속성 (Axios, Redis, 근처 도시, OpenWeather-Apis ...)을 갖춘 Nodejs & Express 웹 앱입니다.
연구 후 배치되면 다음과 같아야합니다.



기본 포트에서 Redis 서버를 실행하고 .env 변수를 채우십시오.
// root folder
NODE_ENV = localhost
GOOGLE_MAPS_API_KEY =
OPENWEATHERMAP_API_KEY = // client
GOOGLE_MAPS_API_KEY =
DEFAULT_LAT = 48.86
DEFAULT_LNG = 2.34
CENTER_LOCATION = paris루트 폴더와 내부 클라이언트 폴더 모두에서
OpenWeatherMap은 더 이상 완전히 자유롭지 않습니다. 테스트를 실행할 키를 얻을 수 없다면 OPENWEATHERMAP_API_KEY 무시하지만 여기에서 가짜 변수를 사용하십시오 : https://github.com/bacloud22/weathervenue/blob/main/libs/consts/fakeonecallapiresponse.js
다음과 같이 fetchWeather 기능을 변경하십시오
import { fakeApiResponse } from '../consts/fakeOneCallApiResponse.js' ;
async function fetchWeather ( city , language ) {
return new Promise ( async ( resolve , reject ) => {
// const APIUrlWeather = `https://api.openweathermap.org/data/3.0/onecall?lat=${city.latitude}&lon=${city.longitude}&lang=${language}&exclude=hourly,minutely&units=metric&appid=${OPENWEATHERMAP_API_KEY}`
// const body0 = await axios.get(APIUrlWeather)
// const data0 = await body0.data
// const APIUrlPollution = `https://api.openweathermap.org/data/2.5/air_pollution?lat=${city.latitude}&lon=${city.longitude}&appid=${OPENWEATHERMAP_API_KEY}`
// const body1 = await axios.get(APIUrlPollution)
// const data1 = await body1.data
// resolve({ weather: data0, pollution: data1 })
resolve ( { weather : fakeApiResponse } )
} )
}또한
const cities = [ nearestCities ( query , 10 ) [ 0 ] ] // nearestCities(query, 10);특정 문제에 대한 열린 문제를 참조하고 새로운 문제를 열어 주시기 바랍니다 (더 나은 코드, 가독성, 모듈성 및 모범 사례, 성능, 더 나은 UI 또는 기능 향상 등).
당신이 기여하는 경우, 한 채널 또는 다른 채널에서 새로운 릴리스를 병합하고 게시 할 수 있다고 생각하십시오. 커피 비용을 생성하기 위해 광고를 추가 할 수 있지만 100% 무료입니다. :)
나와 함께 프로젝트를 유지하고 싶다면; 항상 물어볼 수 있습니다.
어디서나 배포하려면 공정하게 유지하십시오. 허가를 요청하십시오.
달콤한 코딩!
MIT