Skip to content

Instantly share code, notes, and snippets.

View darrylmorley's full-sized avatar

Darryl Morley darrylmorley

View GitHub Profile
@coryhouse
coryhouse / userApi.js
Last active April 12, 2023 00:58
API Wrapper example
/* This API wrapper is useful because it:
1. Centralizes our Axios default configuration.
2. Abstracts away the logic for determining the baseURL.
3. Provides a clear, easily consumable list of JavaScript functions
for interacting with the API. This keeps API calls short and consistent.
*/
import axios from 'axios';
let api = null;