Hands-On Full Stack Development with Spring Boot 2.0 and React: Build modern and scalable full stack applications using the Java-based Spring Framework 5.0 and React by Juha Hinkula

Hands-On Full Stack Development with Spring Boot 2.0 and React: Build modern and scalable full stack applications using the Java-based Spring Framework 5.0 and React by Juha Hinkula

Author:Juha Hinkula [Hinkula, Juha]
Language: eng
Format: epub
Tags: COM060080 - COMPUTERS / Web / General, COM051280 - COMPUTERS / Programming Languages / Java, COM060180 - COMPUTERS / Web / Web Services and APIs
Publisher: Packt Publishing
Published: 2018-06-20T23:00:00+00:00


Practical examples

We will go through two examples of using some open REST APIs. First, we will make a React app that shows the current weather in London. The weather is fetched from OpenWeatherMap (https://openweathermap.org/). You need to register to OpenWeatherMap to get an API key. We will use a free account as that is enough for our needs. When you have registered, navigate to your account info to find the API keys tab. There you'll see the API key that you need for your React weather app:

Let's create a new React app with create-react-app. Open the PowerShell or other terminal you are using, and type the following command:

create-react-app weatherapp

Move to the weatherApp folder:

cd weatherapp

Start your app with the following command:

npm start

Open your project folder with the VS Code and open the App.js file in the editor view. Remove all code inside the <div className="App"></div> divider. Now your source code should look like the following:

import React, { Component } from 'react';

import './App.css';



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.