No error, no response, no connection
shaunclark5649 opened this issue · comments
Shaun Clark commented
Maybe this is something I am doing wrong, I have a nextJS app setup that utilises the next API
I make a request to my endpoint with the following code.
` import Rcon from "rcon-srcds";
const server = new Rcon({
host: process.env.RCON_IP,
port: process.env.RCON_PORT,
});
export default async function handler(req, res) {
try {
await server.authenticate(process.env.RCON_PASSWORD);
await server.connect().then(() => {
console.log("Connected");
});
await server.execute("status").then((response) => {
console.log(response);
res
.status(200)
.json({
message: "RCON command executed successfully.",
reponse: response,
});
});
} catch (error) {
console.error(error);
res.status(500).json({ message: "Error executing RCON command." });
}
}
`
I do not get any error catch, I do not get any logs, all my credentials are correct.
I am not sure if this is my code or the lib, I am at a complete loss.