1.1.2 • Published 1 year ago

axios-tauri-http-adapter v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

axios-tauri-http-adapter

This is an adapter for the tauri plugin http v2. This requires tauri 2.

To install this adapter, run:

# with pnpm
pnpm install axios-tauri-http-adapter
# with npm
npm install axios-tauri-http-adapter
# with yarn
yarn add axios-tauri-http-adapter
# with bun
bun add axios-tauri-http-adapter

Then add the official plugin to your cargo dependencies:

# src-tauri/Cargo.toml
[dependencies]
# ...
tauri-plugin-http = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }

Then add the plugin to your tauri config:

// src-tauri/tauri.conf.json
{
  // ...
  "plugins": {
    "http": {
      // Customize the scope as needed, this will allow all http requests
      "scope": [
        "http://**",
        "https://**"
      ]
    }
  }
}

Then initialize the plugin in your tauri app:

// src-tauri/src/lib.rs or src-tauri/src/main.rs (it may differ depending on how you set up your tauri app)
pub fn run() {
    tauri::Builder::default()
        // ...
        .plugin(tauri_plugin_http::init())
        // ...
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Then add the adapter to your axios instance:

import axiosAdapter from "axios-tauri-http-adapter";

const axiosClient = axios.create({
    adapter: axiosAdapter()
})

Enjoy blazingly fast http requests in your tauri app with axios without having to worry about CORS and other browser limitations.

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.0

3 years ago