flowviz
Version:
A framework which provides seamless integration with other phylogenetic tools and frameworks, while allowing workflow scheduling and execution, through the Apache Airflow workflow system.
34 lines (25 loc) • 693 B
JavaScript
const auth = () => JSON.parse(localStorage.getItem("auth"));
const normalHeader = { "Content-type": "application/json" };
const authHeader = () => {
return {
"Content-type": "application/json",
Authorization: auth() ? `Bearer ${auth().jwt}` : "",
};
};
const options = (method, headers, body) => {
return {
method: method,
headers: headers,
body: body,
};
};
const get = (headers) => options("GET", headers || normalHeader);
const post = (body, headers) => options("POST", headers || normalHeader, body);
const getAuth = () => get(authHeader());
const postAuth = (body) => post(body, authHeader());
export default {
get,
post,
getAuth,
postAuth,
};