1
0
Fork 0

Prepare apiService for base url.

This commit is contained in:
Roger Braun 2016-11-22 15:45:40 +01:00
parent 2147807fa0
commit fd4cd6d687

View file

@ -15,6 +15,12 @@ const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload'
// import { param, ajax } from 'jquery'; // import { param, ajax } from 'jquery';
// import { merge } from 'lodash'; // import { merge } from 'lodash';
let fetch = (url, options) => {
const baseUrl = ''
const fullUrl = baseUrl + url
return window.fetch(fullUrl, options)
}
const authHeaders = (user) => { const authHeaders = (user) => {
if (user) { if (user) {
return { 'Authorization': `Basic ${btoa(`${user.username}:${user.password}`)}` } return { 'Authorization': `Basic ${btoa(`${user.username}:${user.password}`)}` }