Updates
This commit is contained in:
@@ -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";
|
||||
Reference in New Issue
Block a user