Prepare apiService for base url.
This commit is contained in:
parent
2147807fa0
commit
fd4cd6d687
1 changed files with 6 additions and 0 deletions
|
@ -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}`)}` }
|
||||||
|
|
Loading…
Reference in a new issue