Skip to content

App lets user entry country name and fetches country data from restcountries.com. Uses React, Node.js, Express.

Notifications You must be signed in to change notification settings

KajsaMB/country-info-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 

Repository files navigation

Country Information App

This is a web application that allows users to input a country name and retrieve information about that country using data from restcountries.com. The application consists of a React frontend and a Node.js backend built with the Express framework.

Set Up

Backend (Node.js with Express)

  1. Navigate to the 'backend' directory inside the 'country-info-app' directory.

    cd country-info-app/backend

  2. Install the required dependencies

    npm install

Frontend (React)

  1. Navigate to the 'frontend' directory inside the 'country-info-app' directory.

    cd country-info-app/frontend

  2. Install the required dependencies

    npm install

  3. Change the const API_URL in src/App.jsx to "http://localhost:8080/country-info" if running app locally.

Starting the Application

Backend (Node.js with Express)

  1. In the 'backend' directory inside the 'country-info-app' directory, start the Node.js server

    node server.js

The Node.js express server will be running on http://localhost:8080.

Frontend (React)

  1. In the 'frontend' directory inside the 'country-info-app' directory, start the React app.

    npm start

The React app will be running on http://localhost:3000.

Using the Application

  1. Open your web browser and go to http://localhost:3000 to access the application.
  2. Enter the name of the country in the input field.
  3. Click on the 'Get Country Info' button.
  4. The application will display information about the entered country.