generated from BloomTech-Labs/template-fe
-
Notifications
You must be signed in to change notification settings - Fork 7
Utils
Shawn DelPercio edited this page May 27, 2020
·
3 revisions
A set of utility functions to use throughout the app.
A higher order component that takes in a component and props, and returns a new Route only if a token exists in localstorage. If token does not exist, returns a redirect component to the root url.
Returns an axios promise to make requests to the DS Allay API. Sets the baseURL to https://allay23-staging-ds.herokuapp.com/. Also runs request through the cors anywhere api by heroku, https://cors-anywhere.herokuapp.com/
Returns an axios promise to make requests to the Allay back-end API. Sets the baseURL to the environmental variable named 'REACT_APP_databaseURL'. Also adds the token in localstorage onto the authorization header with every request made using this function.