Skip to content

Instantly share code, notes, and snippets.

@ryan2clw
Last active August 24, 2019 00:10
Show Gist options
  • Save ryan2clw/995be74ce5c0f4fa9c571ec43314f6da to your computer and use it in GitHub Desktop.
Save ryan2clw/995be74ce5c0f4fa9c571ec43314f6da to your computer and use it in GitHub Desktop.
Call the bingo backend with AJAX request
import { handleResponse } from '../store/events';
export const getCards = async () => {
const requestOptions = {
method: 'GET'
};
const uri = "http://localhost:8000/cards";
return fetch(uri, requestOptions)
.then(handleResponse)
.then(cards => cards);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment