langflow-chatbot
Version:
Add a Langflow-powered chatbot to your website.
14 lines (13 loc) • 794 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleGetFlowsRequest = handleGetFlowsRequest;
const apiPaths_1 = require("../../config/apiPaths");
const request_utils_1 = require("../request-utils");
async function handleGetFlowsRequest(req, res, makeDirectLangflowApiRequest) {
console.log(`RequestHandler: Received GET request for flows configuration: ${req.url}`);
const targetPath = `${apiPaths_1.LANGFLOW_API_BASE_PATH_V1}${apiPaths_1.LANGFLOW_FLOWS_ENDPOINT_SUFFIX}`;
const queryParams = new URLSearchParams();
queryParams.append('header_flows', 'true');
queryParams.append('get_all', 'true');
await (0, request_utils_1.proxyLangflowApiRequest)(res, () => makeDirectLangflowApiRequest(res, targetPath, 'GET', queryParams));
}