-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1420868
commit 0d877ab
Showing
8 changed files
with
55 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
// import axios, { AxiosInstance } from "axios"; | ||
// import MockAdapter from "axios-mock-adapter"; | ||
// export const mockApi = axios.create(); | ||
|
||
// export default new MockAdapter(axios as AxiosInstance, { delayResponse: 1000 }); | ||
|
||
import axios, { AxiosInstance, Method } from "axios"; | ||
import MockAdapter from "axios-mock-adapter"; | ||
import axios from "axios"; | ||
|
||
export default new MockAdapter(axios); | ||
const axiosInstance = axios.create({ | ||
baseURL: "http://localhost:3000", | ||
method: "GET" as Method, | ||
}); | ||
|
||
export function createAxiosInstance() { | ||
return axiosInstance as AxiosInstance; | ||
} | ||
|
||
const mock = new MockAdapter(createAxiosInstance()); | ||
export default mock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters