Skip to content

Instantly share code, notes, and snippets.

@Remzi1993
Remzi1993 / fetchExamples.js
Last active January 30, 2024 06:21
Examples of using native fetch
// Config / constants
const baseUrl = 'http://localhost:4000' || 'example.herokuapp.com' // or use an environment variable like this: process.env.URL || 'http://localhost:4000'
const JWT = 'Whatever-token'
/*
* Examples of using native fetch
* REST API - CRUD convention (Create/POST, Read/GET, Update/modify/PUT/PATCH, Delete/DELETE)
*
**/