EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
builderClient.js
Go to the documentation of this file.
1const fetch = require("node-fetch");
2
3const BUILDER_URL = "http://127.0.0.1:3001";
4
5/**
6 *
7 * @param os
8 * @param tenantId
9 */
10async function requestBuild(os, tenantId) {
11 const res = await fetch(`${BUILDER_URL}/build`, {
12 method: "POST",
13 headers: { "Content-Type": "application/json" },
14 body: JSON.stringify({ os, tenantId })
15 });
16 return await res.json();
17}
18
19/**
20 *
21 * @param jobId
22 */
23async function requestStatus(jobId) {
24 const res = await fetch(`${BUILDER_URL}/status/${jobId}`);
25 return await res.json();
26}
27
28module.exports = { requestBuild, requestStatus };