/country-happiness-api

Express API to support the front end country happiness application

Primary LanguageJavaScript

Country Happiness API Back End

This project was the backend for assignment 1 in CAB230 which required us to build endpoints to satisfy a predefined Swagger document. It is an API that serves country happiness data.

Can be viewed at https://salty-refuge-23420.herokuapp.com/

Technologies used

  • Express
  • Node
  • MySQL
  • JWT
  • Knex

Get Started

You need MySQL version 8.0.24, Node and npm to run this project.

From your command line, first clone this repo:

# Clone this repository
$ git clone https://github.com/ben04rogers/
country-happiness-api.git

# Go into the repository
$ cd 
country-happiness-api 

Then you can install the dependencies using NPM or Yarn:

Using NPM:

# Install dependencies
$ npm install

Replace the SECRET_KEY in the .env file with a secret key.

The data is available from the SQL dump file at https://drive.google.com/drive/u/1/folders/1ZUy0MKcLtuvOQ5b3NQWididxd2jU5Vw- and that will be necessary to create both the rankings, and users tables. These are the following fields on the database:

databasefieldspic

To start the application

# Start express server
$ npm start