1 | import axios from 'axios'
|
2 |
|
3 | export default function(username: string, password: string) {
|
4 | const headers = {
|
5 | 'Accept': 'application/json',
|
6 | 'User-Agent': 'Bearer'
|
7 | }
|
8 |
|
9 | return axios.create({
|
10 | baseURL: 'https://api.example.com/v1',
|
11 | timeout: 5000,
|
12 | auth: { username, password },
|
13 | headers
|
14 | })
|
15 | }
|