Info-Weather is a java application which uses Spring-boot framework to get weather information.
- java (tested on openjdk 11.0.6)
- spring-boot framework
- node (v12.16.1)
- npm (6.14.4)
- docker(makes it easier)
Clone the repo
Set up an environment variable WEB_APPID and map it to APPID which you can get after signing up on openweathermap. Use this link in case there's an issue in setting up an environment variable.
run the following command on Linux CLI
cd info-weather
./mvnw spring-boot:run
alternatively you can build a jar package and run the jar file.
cd info-weather
./mvnw clean package #to create jar package and remove the existing one
java -jar target/mavenreactjsspringboot-0.0.1-SNAPSHOT.jar
go to http://localhost:8080 and thats it !!
You can make a curl request
curl "http://localhost:8080/weather/current?location={city name}"
You can enter the following url with required parameters in browser.
http://localhost:8080/weather/current?location={city name}
You can make a curl request
curl "http://localhost:8080/weather/forecast?lat={latitude}&lon={longitude}"
You can enter the following url with required parameters in browser.
http://localhost:8080/weather/forecast?lat={latitude}&lon={longitude}
You can also run this using docker.
after cloning the repo , build the image and run it.
docker build -t {your-ideal-image-name} . # to-build
docker run --env WEB_APPID=$WEB_APPID -p 8080:8080 --name {use-creativity} -d {your-ideal-image-name}
After completing the above steps ,following options can be used to get weather information:
go to http://localhost:8080 and thats it !!
You can make a curl request
curl "http://localhost:8080/weather/current?location={city name}"
You can enter the following url with required parameters in browser.
http://localhost:8080/weather/current?location={city name}
You can make a curl request
curl "http://localhost:8080/weather/forecast?lat={latitude}&lon={longitude}"
You can enter the following url with required parameters in browser.
http://localhost:8080/weather/forecast?lat={latitude}&lon={longitude}
Thanks to openweathermap api
Thanks to timbru31 for java-nodejs docker image