Configuration
Initial configuration of external libs.
Overview
In this section, we will configure the axios kit and stellar wallet. Everything you need to make it work.
Environment Variables
For this project, we'll use the beta environment. In order to request the API Key, please go to our dApp and request it. You can see this section below as well:
NEXT_PUBLIC_API_URL_DEV=https://beta.api.trustlesswork.com
NEXT_PUBLIC_API_KEY=YOUR API KEYAxios Configuration
import axios from "axios";
/**
*
* Axios Instance
* @Reference URL: https://axios-http.com/docs/intro
*
*/
const http = axios.create({
baseURL: NEXT_PUBLIC_API_URL_DEV,
timeout: 60000, // 1 minute
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.NEXT_PUBLIC_API_KEY}`,
},
});
export default http;