mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-16 04:54:52 +02:00
19 lines
459 B
JavaScript
19 lines
459 B
JavaScript
import Axios from "axios";
|
|
|
|
const client = Axios.create({
|
|
withCredentials: true,
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
});
|
|
|
|
client.interceptors.response.use(res => res, err => {
|
|
if(err.response.status === 502) {
|
|
window.flash("Service not available", "red");
|
|
} else if (err.response.status !== 401) {
|
|
window.flash(err.response.data, "red");
|
|
}
|
|
return Promise.reject(err);
|
|
});
|
|
|
|
export default client; |