Giter Club home page Giter Club logo

noroff-assignment-api's Introduction

Noroff Assignment API

The Noroff Assignment API will be used to complete each of the assignments using JavaScript Frameworks.

Prerequisites

In order to use the API you will require the following:

  1. Install Git
  2. Install NodeJS LTS with npm (It must be the LTS version.)
  3. Create a Heroku account (free)

Instructions

Follow the below instructions to get your API setup and ready for use.

  1. Fork this repository and clone the forked repository to your computer
  2. Run npm install in the root of the cloned repository
  3. Ensure you have the Heroku CLI Installed by running heroku --version in your terminal app
  4. Run the following commands (In the project root directory):
    • Remove the cloned repository: git remote remove origin
    • Create a new Heroku App: heroku create <choose-a-name-for-your-app>
      • e.g. heroku create noroff-assignment-api
      • Please note: The name chosen must be unique on the .herokuapp.com domain
    • Ensure all files are added to git git add .
    • Commit all the files: git commit -m "FEAT: Heroku"
    • Push the files to your heroku app: git push heroku master
  5. The app will be automatically deployed and started.
  6. Check the terminal for your API's Url.

API Key and Authorization Header

Lastly, on your Heroku Dashboard, open your API application, find the settings tab and look for the Config Vars section

Locate the "Reveal Config Vars" button and click it

img.png

Enter TWO config vars:

NODE_ENV : production
API_KEY : any randomly generated string (64 characters)

See the screenshot below.

img.png

Accessing Endpoints

Each API endpoint contains both open and protected endpoints. All GET endpoints are open. Any other method POST, PUT, PATCH and DELETE is protected with the X-API-KEY header.

Trivia Game API

Trivia API Docs

Lost in Translation API

Lost In Translation

Pokémon Trainer API

Pokémon Trainer

Special thanks to Typicode for json-server

Github: json-server

noroff-assignment-api's People

Contributors

dewaldels avatar dewald-els avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.