Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4 feauture branch route setup cw #28

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
> _Fork_ deze leertaak en ga aan de slag. Onderstaande outline ga je gedurende deze taak in jouw eigen GitHub omgeving uitwerken. De instructie vind je in: [docs/INSTRUCTIONS.md](docs/INSTRUCTIONS.md)

# Titel
<!-- Geef je project een titel en schrijf in één zin wat het is -->
# Groep Elite redpers
## Doel


## leden
* Jason
* Jesse
* Christopher



## Inhoudsopgave

Expand All @@ -26,8 +33,13 @@
## Installatie
<!-- Bij Instalatie staat hoe een andere developer aan jouw repo kan werken -->

## Bronnen
***

> _Fork_ deze leertaak en ga aan de slag. Onderstaande outline ga je gedurende deze taak in jouw eigen GitHub omgeving uitwerken. De instructie vind je in: [docs/INSTRUCTIONS.md](docs/INSTRUCTIONS.md)


> _Fork_ deze leertaak en ga aan de slag. Onderstaande outline ga je gedurende deze taak in jouw eigen GitHub omgeving uitwerken. De instructie vind je in: [docs/INSTRUCTIONS.md](docs/INSTRUCTIONS.md)

## Licentie

This project is licensed under the terms of the [MIT license](./LICENSE).
This project is licensed under the terms of the [MIT license](./LICENSE).
20 changes: 20 additions & 0 deletions helpers/fetch-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* An asynchronous helper function that wraps the standard node.js fetch API.
* This function calls an API url passed as the first and mandatory parameter,
* there is an optional payload parameter to send a json object, eg. a filter.
* It then calls the API and returns the response body parsed as a json object.
* @example <caption>fetchJson as returning function using the await keyword</caption>
* const data = await fetchJson('https://api-url.com/endpoint/')
* @example <caption>fetchJson as oneliner using the then() structure.</caption>
* fetchJson('https://api-url.com/endpoint/').then((data)=>{
* // use data...
* })
* @param {string} url the api endpoint to address
* @param {object} [payload] the payload to send to the API
* @returns the response from the API endpoint parsed as a json object
*/
export default async function fetchJson(url, payload = {}) {
return await fetch(url, payload)
.then((response) => response.json())
.catch((error) => error)
}
Loading