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.
35 lines (28 loc) • 701 B
JavaScript
const onSuccess = require("./controllerUtils");
module.exports = (service) => {
function getTools(req, res, next) {
service
.getTools()
.then((data) => onSuccess(res, data))
.catch((err) => next(err));
}
function getTool(req, res, next) {
const toolName = req.params.name;
service
.getTool(toolName)
.then((data) => onSuccess(res, data))
.catch((err) => next(err));
}
function addTool(req, res, next) {
const tool = req.body;
service
.addTool(tool)
.then((data) => onSuccess(res, data, 201))
.catch((err) => next(err));
}
return {
getTools: getTools,
getTool: getTool,
addTool: addTool,
};
};