mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-18 12:33:06 +00:00
23 lines
710 B
TypeScript
23 lines
710 B
TypeScript
import { FastifyPluginAsync } from 'fastify';
|
|
import { errorHandler, listSettings, version } from '../../../../lib/common';
|
|
|
|
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
|
fastify.get('/', async () => {
|
|
const settings = await listSettings()
|
|
try {
|
|
return {
|
|
ipv4: settings.ipv4,
|
|
ipv6: settings.ipv6,
|
|
version,
|
|
whiteLabeled: process.env.COOLIFY_WHITE_LABELED === 'true',
|
|
whiteLabeledIcon: process.env.COOLIFY_WHITE_LABELED_ICON,
|
|
}
|
|
} catch ({ status, message }) {
|
|
return errorHandler({ status, message })
|
|
}
|
|
});
|
|
|
|
};
|
|
|
|
export default root;
|