# APIs not loading in ads file ?
Module:
view-module
- Make sure you have added remote api point in .kview file i.e remote-api-point < name of the api > => "any variable name"
Example:
module libraryview (libraryview)
remote-api-point LibraApi => "LibraApi"
route "library" // "specify-route-fragment-here-no-leading-slash"
NOTE
It has to be placed before route and after module.
- Open
remote-api-point.tsin VScode and add the line "export const LibraApi = axios; outside the export"
import axios from 'axios';
export default class RemoteApiPoint {
public static setup() {
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
}
}
export const LibraApi = axios;