-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: new API interaction
- Удалена функция api. - Новый формат взаимодействия с API, разделяя обращения к методам на роуты. К тому же, никакого fetch - теперь это Axios.
- Loading branch information
1 parent
59bdf2e
commit 87c8901
Showing
7 changed files
with
33 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VITE_BACKEND_URL=https://app-backend.koka.team | ||
VITE_BACKEND_URL=https://api.sampleapis.com/ |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import axios from "axios"; | ||
|
||
export const NETWORK = axios.create({ | ||
baseURL: import.meta.env.VITE_BACKEND_URL, | ||
timeout: 5e3, | ||
validateStatus: () => true, | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${ | ||
window.location.href | ||
.slice(window.location.href.indexOf("?") + 1) | ||
.split("#")[0] | ||
}`, | ||
}, | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { NETWORK } from "../api.instance"; | ||
|
||
export const getCoffeeList = () => NETWORK.get("coffee/hot"); |
This file was deleted.
Oops, something went wrong.
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