E-CommerceGameHub

GameHub

These endpoints allow you to retrieve all products, or a single product by its id. The response will be an array of JSON objects if you request all products, or a single JSON object if you request a single product.

The GameHub model

PropTypeDefault
id
string
-
title
string
-
description
string
-
genre
string
-
released
string
-
ageRating
string
-
price
float
-
discountedPrice
float
-
onSale
boolean
-
image
object
-
tags
Array<string>
-
favorite
boolean
-

All products

GET/gamehub

Retrieve all products.

Response
{
  "data": [
    {
      "id": "ded6041a-622f-4fb4-81e4-96fcfdad4dff",
      "title": "Ping Pong Championship",
      "description": "Enter the world of Ping Pong Championship and compete against the world's best to become the ultimate champion in this exciting game.",
      "genre": "Sports",
      "released": "2005",
      "ageRating": "3+",
      "price": 14.99,
      "discountedPrice": 4.79,
      "onSale": true,
      "image": {
        "url": "https://static.cloud.noroff.dev/api/gamehub/0-ping-pong-championship.jpg",
        "alt": "Ping Pong Championship logo on a blue background"
      },
      "tags": ["gamehub", "game"],
      "favorite": true
    },
    {
      "id": "2ace4e1d-cad7-4d35-8d59-6c9ac3e3eaf8",
      "title": "Super Duper",
      "description": "Celebrate some of the world's supe duper Superheroes with augmented reality.",
      "genre": "Adventure",
      "released": "2006",
      "ageRating": "3+",
      "price": 15.99,
      "discountedPrice": 15.99,
      "onSale": false,
      "image": {
        "url": "https://static.cloud.noroff.dev/api/gamehub/1-super-duper.jpg",
        "alt": "Super Duper logo on a yellow background"
      },
      "tags": ["gamehub", "game"],
      "favorite": true
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Single product

GET/gamehub/<id>

Retrieve a single product by its id.

Response
{
  "data": {
    "id": "ded6041a-622f-4fb4-81e4-96fcfdad4dff",
    "title": "Ping Pong Championship",
    "description": "Enter the world of Ping Pong Championship and compete against the world's best to become the ultimate champion in this exciting game.",
    "genre": "Sports",
    "released": "2005",
    "ageRating": "3+",
    "price": 14.99,
    "discountedPrice": 4.79,
    "onSale": true,
    "image": {
      "url": "https://static.cloud.noroff.dev/api/gamehub/0-ping-pong-championship.jpg",
      "alt": "Ping Pong Championship logo on a blue background"
    },
    "tags": ["gamehub", "game"],
    "favorite": true
  },
  "meta": {}
}