1.0.2 • Published 4 years ago

axios-electron-adapter v1.0.2

Weekly downloads
7
License
MIT
Repository
-
Last release
4 years ago

axios-electron-adapter

The axios adapter for electron net request

Using XHR in Electron production mode will be blocked by CORS

# Origin in dev mode
    origin: http://localhost:8080
# Origin in production mode (Executable standalone)
    origin: file://

Usage

import ElectronAdapter from 'axios-electron-adapter'

# Replace default adapter on boot
AxiosStatic.defaults.adapter = ElectronAdapter

# General request make
const EXAMPLE_BASEURL = 'http://localhost'
const EXAMPLE_POST_DATA = {
    title: "The sign"
}
Axios.post('/myworld/signs', EXAMPLE_POST_DATA)

Warning

The request made by Electron will not be recorded in Devtools > Network

Github

Explore

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago