- Import Api
- Create fetcher instance
- Set authorization
- Create api instance
- Call methods
let fetcher = new DirectusFetcher('http://api.address.com')
.setAuthorizationHeader('Bearer fdafdsa453')
let api = new Api(fetcher )
.getAppInfo()
.then(appinfo => console.dir(appinfo));
- getAppInfo(): Promise;
- getAbout(): Promise;
- getWorks(): Promise<Work[]>;
- getServices(): Promise<Service[]>;
- getExperiences(): Promise<Experience[]>;
- getSkills(): Promise<Skill[]>;
- getEducations(): Promise<Education[]>;
- getLanguages(): Promise<Language[]>;
- getSocials(): Promise<Social[]>;
- getApiUrl():string;
- getBaseUrl(): string;
- setApiUrl(apiUrl: string);
- setBaseUrl(baseUrl: string);
- setAuthorizationHeader(token:string): IFetcher;
title: string;
contact_email: string;
main_image: Image;
logo: Image;
avatar_image: Image;
cover_letter: string;
title: string;
url: string;
date: string;
info: string;
thumbnail: Image;
color: string;
- import property 'vuePlugin' as torchioapi
- options baseUrl is required
Vue.use(torchioapi, {
baseUrl: 'https://api.torchiodev.com',
authentication: 'bearer hu5i432higfd...',
propertyName: 'whateverYouWant' // makes accessible in this.$whateverYouWant
});