Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/persiliao/axios-tauri-api-adapter
Makes it easy to use Axios in Tauri App
https://github.com/persiliao/axios-tauri-api-adapter
api axios axios-adapter http tauri tauri-app tauri2
Last synced: 5 days ago
JSON representation
Makes it easy to use Axios in Tauri App
- Host: GitHub
- URL: https://github.com/persiliao/axios-tauri-api-adapter
- Owner: persiliao
- License: mit
- Created: 2022-07-17T01:12:27.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-11T23:53:59.000Z (4 months ago)
- Last Synced: 2024-10-15T10:32:33.669Z (4 months ago)
- Topics: api, axios, axios-adapter, http, tauri, tauri-app, tauri2
- Language: JavaScript
- Homepage:
- Size: 448 KB
- Stars: 65
- Watchers: 4
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-tauri - axios-tauri-api-adapter - Makes it easy to use Axios in Tauri, `axios` adapter for the `@tauri-apps/api/http` module. (Development / Integrations)
README
# axios-tauri-api-adapter
[![](https://img.shields.io/npm/v/axios-tauri-api-adapter)](https://www.npmjs.com/package/axios-tauri-api-adapter)
[![](https://img.shields.io/npm/l/axios-tauri-api-adapter)](https://github.com/persiliao/axios-tauri-api-adapter/blob/master/LICENSE)Makes it easy to use Axios in Tauri App, Adapted for Tauri App 2.0.0
v1 version see https://github.com/persiliao/axios-tauri-api-adapter/tree/v1
# Installation
```
npm install axios-tauri-api-adapter
```# Usage
### **TypeScript / JavaScript**
```js
import axios from 'axios';
import axiosTauriApiAdapter from 'axios-tauri-api-adapter';
const client = axios.create({ adapter: axiosTauriApiAdapter });
```### **Tauri App**
Configure the allowed URLs [Tauri App HTTP client](https://v2.tauri.app/plugin/http-client/#usage)
```json5
{
"permissions": [
{
"identifier": "http:default",
"allow": [{ "url": "https://*.tauri.app" }],
"deny": [{ "url": "https://private.tauri.app" }]
}
]
}
```# Features
- Add `config.jwt` It's going to add JWT to the header# Resources
* [Changelog](https://github.com/persiliao/axios-tauri-api-adapter/blob/master/CHANGELOG.md)
* [Contributing Guide](https://github.com/persiliao/axios-tauri-api-adapter/blob/master/CONTRIBUTING.md)
* [Code of Conduct](https://github.com/persiliao/axios-tauri-api-adapter/blob/master/CODE_OF_CONDUCT.md)