pinafore/routes/_api/utils.js
Nolan Lawson 8eb30d02e9
chore: cleanup travis scripts (#766)
* chore: cleanup travis scripts

* remove unused script
2018-12-08 17:15:01 -08:00

17 lines
395 B
JavaScript

function targetIsLocalhost (instanceName) {
return instanceName.startsWith('localhost:') || instanceName.startsWith('127.0.0.1:')
}
export function basename (instanceName) {
if (targetIsLocalhost(instanceName)) {
return `http://${instanceName}`
}
return `https://${instanceName}`
}
export function auth (accessToken) {
return {
'Authorization': `Bearer ${accessToken}`
}
}