Consistent “Incomplete response received from application” – NodeJS app on cPanel with Express

I’m working on a NodeJS API. For the sake of clarification, we’ll say my API url is api.mydomain.com. The endpoint that I’m having trouble with is /ts/password. This endpoint’s function is to send a GET request to my Teamspeak3 server webquery to generate a temporary password (using the npm package axios). Everything seems to work as intended when I’m running the API locally on my machine in VS Code, but when I upload it to my hosting provider via cPanel’s built-in NodeJS app module, this /ts/password endpoint returns “Incomplete response received from application”
when a request is sent to it. I have reviewed my code countless times, and can’t seem to find any reason as to why this is happening; but it’s even more confusing how it works on my local machine when the endpoint is called via localhost, but not when called through my domain when hosted on cPanel. I’ve also tried reinstalling node modules, but wasn’t successful there either.

const configFile = require("./config.json")

const express = require("express")
const mysql = require("mysql")
const app = express()
const bodyParser = require("body-parser")
const axios = require("axios")
const panelHeaders = {
    headers: { Authorization: `Bearer ${configFile.panelApiKey}` }
}
const dbConn = mysql.createConnection({
    host: configFile.mdbHost,
    user: configFile.mdbUsername,
    password: configFile.mdbPassword,
    database: configFile.mdbName
})

app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))

const characters ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

function generateTsPassword(length) {
    let result = '';
    const charactersLength = characters.length;
    for ( let i = 0; i < length; i++ ) {
        result += characters.charAt(Math.floor(Math.random() * charactersLength));
    }

    return result;
}

app.get("/ts/password", (req, res) => {
    const endpoint = "/ts/password"
    if(req.headers.authorization === configFile.apiKey) {
        const tempPw = generateTsPassword(8)
        const url = "http://ts3.operationsrp.com:10080/1/servertemppasswordadd?api-key=" + configFile.ts3ApiKey + "&pw=" + tempPw + "&duration=300&desc=Via+OperationsRP+API"
        axios.get(url)
            .then(function (response) {
                if(response.data.status.code === 0) {
                    res.status(200).send({status: "SUCCESS", statusCode: 200, password: tempPw})
                } else if(response.data.status.code === 1539) {
                    res.status(400).send({status: "BAD_REQUEST", statusCode: 400, message: "An error occurred with the downstream request: required parameter not found. Try again later or contact development."}) // occurrs when a required url query param sent via the teamspeak api url is missing
                }
            })
            .catch(function (error) {
                if(error.response.data.status.code === 7) {
                    res.status(500).send({status: "ERROR", statusCode: 500, message: "An unknown error occurred with the downstream request, and it was cancelled. Try again later or contact development."}) // usually occurrs when the virtual server id is incorrect/not found
                } else if(error.response.data.status.code === 1538) {
                    res.status(404).send({status: "NOT_FOUND", statusCode: 404, message: "An error occurred with the downstream request: invalid command or endpoint. Try again later or contact development."}) // occurrs when the command/endpoint sent via the teamspeak api url is not valid
                } else if(error.response.data.status.code === 5122) {
                    res.status(401).send({status: "UNAUTHORIZED", statusCode: 401, message: "An error occurred with the downstream request: invalid API key. Try again later or contact development."}) // occurrs when the api key sent via the teamspeak api in the url query param is not valid
                } else if(error.response.data.status.code === 5124) {
                    res.status(401).send({status: "UNAUTHORIZED", statusCode: 401, message: "An error occurred with the downstream request: missing API key. Try again later or contact development."}) // occurrs when no api key is supplied in the request to the teamspeak api
                } else {
                    res.status(500).send({status: "ERROR", statusCode: 500, message: "An unknown error occurred with the downstream request. Try again later or contact development."}) // could really be anything
                }
            })
    } else {
        res.status(401).send({status: "UNAUTHORIZED", statusCode: 401, message: "Missing or invalid API key."})
    }
})