Closed Formyown closed 5 years ago
@Formyown
If u use Axios
, u can set baseUrl like
axios.defaults.baseURL = 'https://api.example.com';
axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
or
const instance = axios.create({
baseURL: 'https://api.example.com'
});
I know there is a way to customize base url for all APIs, but it's better to add an option into ISwaggerOption. Cause most time we need to specify the backend server host and port.
What I want is some thing looks like:
and I look through the source code, there may useless tips(lol):