@sabuj0338/axios-friday 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @sabuj0338/axios-friday
|
|
2
|
+
This is an Axios-based customized class `Friday` that appears to be designed for making API requests with authentication and token refresh capabilities.
|
|
3
|
+
|
|
4
|
+
This library uses `cookie` to store `access_token` and `refresh_token`.
|
|
5
|
+
|
|
6
|
+
`@sabuj0338/axios-friday` is a TypeScript library for dealing with API requests.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @sabuj0338/axios-friday
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import Friday from '@sabuj0338/axios-friday'
|
|
19
|
+
|
|
20
|
+
# Example, Configure first
|
|
21
|
+
|
|
22
|
+
const baseURL = "https://sabuj0338.github.io/portfolio";
|
|
23
|
+
|
|
24
|
+
const friday = new Friday({
|
|
25
|
+
baseURL: baseURL,
|
|
26
|
+
# accessTokenKey: "access_token",
|
|
27
|
+
# refreshTokenKey: "refresh_token",
|
|
28
|
+
# refreshTokenAPI: "/api/refresh",
|
|
29
|
+
# enableRefreshToken: false,
|
|
30
|
+
# enableAccessToken: true,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
# returns 'AxiosResponse'
|
|
34
|
+
const response = await borak.get(new URL(baseURL));
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Contributing
|
|
39
|
+
|
|
40
|
+
Pull requests are welcome. For major changes, please open an issue first
|
|
41
|
+
to discuss what you would like to change.
|
|
42
|
+
|
|
43
|
+
Please make sure to update tests as appropriate.
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
package/package.json
CHANGED