/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import fastify from "fastify";
import { logHandler } from "../utils/logHandler.js";
const html = `
Aria Iuvo
Aria Iuvo
Bot to translate your messages on Discord!
`;
/**
* Starts up a web server for health monitoring.
*/
export const instantiateServer = (): void => {
try {
const server = fastify({
logger: false,
});
server.get("/", (_request, response) => {
response.header("Content-Type", "text/html");
response.send(html);
});
server.listen({ port: 5002 }, (error) => {
if (error) {
logHandler.error(error);
return;
}
logHandler.info("Server listening on port 5002.");
});
} catch (error) {
logHandler.error(error);
}
};