Files
oneuptime/Docs/Index.ts
Nawaz Dhandala b1ed2c00c4 Add documentation views and partials for error handling and content display
- Created NotFound.ejs for 404 error page with navigation and header.
- Added ServerError.ejs for 500 error page with retry and documentation link.
- Introduced Content.ejs partial for displaying documentation articles.
- Implemented Head.ejs partial for consistent head elements across pages.
- Developed Header.ejs partial for site header with navigation links.
- Created Nav.ejs partial for documentation navigation structure.
- Added OpenSourceCommitment.ejs partial to highlight open-source contributions.
- Implemented Pagination.ejs partial for navigation between documentation pages.
2026-02-23 18:14:15 +00:00

55 lines
1.5 KiB
TypeScript
Executable File

import DocsRoutes from "./Services/Docs/Routes";
import APIReferenceRoutes from "./Services/APIReference/Routes";
import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
import InfrastructureStatus from "Common/Server/Infrastructure/Status";
import logger from "Common/Server/Utils/Logger";
import App from "Common/Server/Utils/StartServer";
import Telemetry from "Common/Server/Utils/Telemetry";
import "ejs";
const APP_NAME: string = "docs";
const init: PromiseVoidFunction = async (): Promise<void> => {
try {
// Initialize telemetry
Telemetry.init({
serviceName: APP_NAME,
});
const statusCheck: PromiseVoidFunction = async (): Promise<void> => {
// Check the status of infrastructure components
return await InfrastructureStatus.checkStatusWithRetry({
checkClickhouseStatus: false,
checkPostgresStatus: false,
checkRedisStatus: false,
retryCount: 3,
});
};
// Initialize the app with service name and status checks
await App.init({
appName: APP_NAME,
statusOptions: {
liveCheck: statusCheck,
readyCheck: statusCheck,
},
});
await DocsRoutes.init();
await APIReferenceRoutes.init();
// Add default routes to the app
await App.addDefaultRoutes();
} catch (err) {
logger.error("App Init Failed:");
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.error("Exiting node process");
process.exit(1);
});