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