API Platform example, simple REST
Is there an example for using API platform and a simple REST dataProvider?
Note: you can ask me a follow up question by @ mentioning me again authProvider using axios calls. This example is taken from the extracts above:authProvider is then passed to the <Refine> component.authProvider in the refine documentation (https://refine.dev/docs/tutorial/understanding-authprovider/create-authprovider).Note: you can ask me a follow up question by @ mentioning me again 
Note: you can ask me a follow up question by @ mentioning me againNote: you can ask me a follow up question by @ mentioning me againimport { AuthBindings } from "@refinedev/core";
import axios from "axios";
const axiosInstance = axios.create();
const mockUsers = [
{ username: "admin", token: "123" },
{ username: "editor", token: "321" },
];
const App = () => {
const authProvider: AuthBindings = {
login: async ({ username, password }) => {
// Suppose we actually send a request to the back end here.
const user = mockUsers.find((item) => item.username === username);
if (user) {
localStorage.setItem("auth", JSON.stringify(user));
// This sets the authorization headers on Axios instance
axiosInstance.defaults.headers.common = {
Authorization: `Bearer ${user.token}`,
};
return {
redirectTo: "/",
success: true,
};
}
return {
success: false,
error: {
name: "Login Error",
message: "Username or password is incorrect",
},
};
},
// ---
};
return (
<Refine
authProvider={authProvider}
routerProvider={routerProvider}
// In order to use the axios instance, we need to pass it to the dataProvider
dataProvider={dataProvider(API_URL, axiosInstance)}
/>
);
};