This commit is contained in:
Benjamin Toby
2025-01-13 09:00:21 +01:00
parent 6364f6a312
commit e0a030f10d
859 changed files with 5397 additions and 10163 deletions
@@ -1,15 +1,19 @@
// @ts-check
const http = require("http");
const fs = require("fs");
const path = require("path");
const { exec, execSync, execFile, spawn, spawnSync } = require("child_process");
const { createHmac } = require("crypto");
import http from "http";
import fs from "fs";
import path from "path";
import { exec, execSync, execFile, spawn, spawnSync } from "child_process";
import { createHmac } from "crypto";
require("dotenv").config({
path: path.resolve(__dirname, ".env"),
});
declare global {
var NODE_ENVIRONMENT: any;
}
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
@@ -90,7 +94,7 @@ server.on("request", (req, res) => {
let parsedData = (() => {
try {
return JSON.parse(data.toString());
} catch (error) {
} catch (error: any) {
console.log(error.message);
return data.toString();
}
@@ -99,11 +103,11 @@ server.on("request", (req, res) => {
console.log("Request Received", parsedData);
if (req.url == process.env.ENDPOINT) {
/** @type {import("child_process").SpawnSyncOptionsWithBufferEncoding} */
const options = {
cwd: workingDirectory,
stdio: "inherit",
};
const options: import("child_process").SpawnSyncOptionsWithBufferEncoding =
{
cwd: workingDirectory,
stdio: "inherit",
};
if (process.platform?.match(/win/i)) {
options.shell = "bash.exe";