Commit a3b8ea81 authored by Weiser's avatar Weiser
Browse files

Merge branch 'master' of...

Merge branch 'master' of https://transfer.hft-stuttgart.de/gitlab/22kaen1bdi/swp_ss24_wetterdaten_sammeln
parents 4bb36d4b 9ceccc60
## How to start this application
## Before you start this application
1. You have to install Maven:
1. Have a JDK installation on your system. Either set the JAVA_HOME environment variable pointing to your JDK installation or have the java executable on your PATH.
2. Download zip from here [https://maven.apache.org/download.cgi]
3. Extract distribution archive in any directory
4. Unzip apache-maven-3.9.7-bin.zip
5. Add the bin directory of the created directory apache-maven-3.9.7 to the PATH environment variable.
6. Confirm with ```mvn -v``` in a new shell. The result should look similar to
```Apache Maven 3.9.7 (8b094c9513efc1b9ce2d952b3b9c8eaedaf8cbf0)
Maven home: /opt/apache-maven-3.9.7
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"```
2. You have to install node:
1. Download the installer here [https://nodejs.org/en/download/prebuilt-installer]
2. Click through the installer
3. Confirm with ```node -v``` in a new shell. The result should look similar to ```v20.14.0```
4. Confirm with ```npm -v```. The result should look similar to ```10.7.0```
3. If using Chrome, you have to install a extension:
1. Open up a terminal
2. Type: ./mvnw spring-boot:run
3. Open up another terminal
4. Type: cd frontend
5. If running for the first time
Type: npm install
6. Type: npm run start (dev) / npm run build (production)
1. Download extension here [https://chromewebstore.google.com/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf]
2. Activate extension
## How to start this application
1. Open up project in VSCode
2. Open up a terminal
3. Type: ```./mvnw spring-boot:run```
4. Open up another terminal
5. Type: ```cd frontend```
6. If running for the first time, Type: ```npm install```
7. Type: ```npm run start``` (for dev) or ```npm run build``` (for production)
## How to stop this application
1. Go to both Terminals
2. Press Ctrl + C
3. Type: j
2. Press ```Ctrl + C```
3. Type: ```j```
4. Deactivate Chrome extension
## Troubleshooting
1. There are errors all over the backend.<br/>
You have to reload the Maven project. In VSCode navigate to "Maven" on the lower left corner and press the reload button.
2. Backend Server doesn't start / it throws errors.<br/>
You can alternatively start the server with VSCode. Navigate to src/main/java/io/swagger/Swagger2SpringBoot.java and press "Run"
......@@ -44,7 +44,7 @@ public class CurrentweatherApiController implements CurrentweatherApi {
ApiService apiService = new ApiService(restTemplate);
String data = apiService.getDataFromFirstApi(
"https://api.weatherapi.com/v1/current.json?key=1244099aeaee4b179e6111803241304&q=" + q
"https://api.weatherapi.com/v1/current.json?key=afe1585243b94bec9d670336241206&q=" + q
+ "&aqi=yes");
ResponseEntity<Model200> response = new ResponseEntity<Model200>(objectMapper.readValue(
......
......@@ -53,7 +53,7 @@ public class ForecastweatherApiController implements ForecastweatherApi {
ApiService apiService = new ApiService(restTemplate);
String data = apiService.getDataFromFirstApi(
"https://api.weatherapi.com/v1/forecast.json?key=1244099aeaee4b179e6111803241304&q=" + q
"https://api.weatherapi.com/v1/forecast.json?key=afe1585243b94bec9d670336241206&q=" + q
+ "&days=" + days + "&aqi=yes&alerts=" + alerts);
ResponseEntity<Modelforecast> response = new ResponseEntity<Modelforecast>(objectMapper.readValue(
......
......@@ -44,7 +44,7 @@ public class SearchApiController implements SearchApi {
ApiService apiService = new ApiService(restTemplate);
String data = apiService.getDataFromFirstApi(
"http://api.weatherapi.com/v1/search.json?key=1244099aeaee4b179e6111803241304&q=" + city);
"http://api.weatherapi.com/v1/search.json?key=afe1585243b94bec9d670336241206&q=" + city);
@SuppressWarnings("unchecked")
ResponseEntity<List<Search>> response = new ResponseEntity<List<Search>>(objectMapper.readValue(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment