hackathon/web_src/lib/pb/pbutil.ts

20 lines
357 B
TypeScript

import { browser } from '$app/env';
const protocol = browser ? window.location.protocol : 'http:';
const pathPrefix = protocol + '//api.playcode.quest';
export const withToken = (token: string): any => {
return {
pathPrefix,
headers: {
Authorization: `Bearer ${token}`
}
};
};
export const noToken = (): any => {
return {
pathPrefix
};
};