| 1234567891011121314151617181920212223 |
- import axios from 'axios';
- //const csrfParamName = document.querySelector('meta[name="csrf-param"]').content;
- //const csrfToken = document.querySelector('meta[name="csrf-token"]').content;
- const instance = axios.create({
- baseURL: 'http://localhost:3000/api/v1',
- timeout: 3000,
- responseType: 'json',
- headers: {post: {'Content-Type': 'application/json'}},
- //xsrfHeaderName: csrfParamName,
- });
- export const Pokemon = {
- index: async () => instance.get('/pokemon'),
- get: async id => instance.get(`/pokemon/${id}`),
- };
- const API = {
- Pokemon,
- };
- export default API;
|