Added AxiosStrategy and ProxyStrategy Network Strategies
This commit is contained in:
parent
119eb321ec
commit
61d7dcf61b
2 changed files with 21 additions and 0 deletions
8
functions/strategies/AxiosStrategy.js
Normal file
8
functions/strategies/AxiosStrategy.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import axios from "axios";
|
||||
|
||||
const axiosStrategy = async (req, _store) => {
|
||||
const res = await axios(req);
|
||||
return res;
|
||||
}
|
||||
|
||||
export default axiosStrategy;
|
||||
13
functions/strategies/ProxyStrategy.js
Normal file
13
functions/strategies/ProxyStrategy.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import axios from "axios";
|
||||
|
||||
const proxyStrategy = async (req, store) => {
|
||||
const proxyRes = await axios.post(
|
||||
store.state.postwoman.settings.PROXY_URL ||
|
||||
"https://postwoman.apollotv.xyz/",
|
||||
req
|
||||
);
|
||||
|
||||
return proxyRes.data;
|
||||
}
|
||||
|
||||
export default proxyStrategy;
|
||||
Loading…
Reference in a new issue