source:
frontend/src/axios.js@
ac19a0c
Last change on this file since ac19a0c was ac19a0c, checked in by , 10 months ago | |
---|---|
|
|
File size: 358 bytes |
Rev | Line | |
---|---|---|
[e9b4ba9] | 1 | import axios from "axios"; |
2 | ||
[ac19a0c] | 3 | |
[e9b4ba9] | 4 | const instance = axios.create({ |
5 | baseURL: "http://localhost:8080/", | |
6 | withCredentials: true, | |
[ac19a0c] | 7 | maxRedirects: 1, |
8 | beforeRedirect: (options, { headers }) => { | |
9 | console.log(options) | |
10 | if (options.hostname === "example.com") { | |
11 | options.auth = "user:password"; | |
12 | }} | |
[e9b4ba9] | 13 | |
[ac19a0c] | 14 | }) |
[e9b4ba9] | 15 | |
16 | export default instance |
Note:
See TracBrowser
for help on using the repository browser.