const fastify = require('fastify')({ logger: true });
let MANAGEMENT_SERVER_PORT = 1689;
let SERVER_HOST = '0.0.0.0';
console.log(`************ Management Server v 0.002 ************`);
fastify.get('/', async (request, reply) => {
const localUrl = request.headers['host'];
let htmlContent = `
Proxy Server
`;
reply.type('text/html').send(htmlContent);
});
const start = async () => {
try {
await fastify.listen({ port: MANAGEMENT_SERVER_PORT, host: SERVER_HOST });
console.log(`Server is listening on port ${MANAGEMENT_SERVER_PORT}`);
} catch (err) {
console.error(`Error starting server: ${err}`);
process.exit(1);
}
};
start();