oneuptime/ApiReference/Service/Introduction.ts

31 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-03-18 21:48:21 +00:00
import { ExpressRequest, ExpressResponse } from 'CommonServer/Utils/Express';
import ResourceUtil, { ModelDocumentation } from '../Utils/Resources';
2023-03-18 21:37:34 +00:00
2023-03-18 21:48:21 +00:00
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
const FeaturedResources: Array<ModelDocumentation> =
ResourceUtil.getFeaturedResources();
2023-03-18 21:37:34 +00:00
2023-03-18 21:48:21 +00:00
export default class ServiceHandler {
public static async executeResponse(
req: ExpressRequest,
res: ExpressResponse
): Promise<void> {
let pageTitle: string = '';
let pageDescription: string = '';
const page: string | undefined = req.params['page'];
const pageData: any = {};
2023-03-18 21:37:34 +00:00
pageData.featuredResources = FeaturedResources;
2023-03-18 21:48:21 +00:00
pageTitle = 'Introduction';
pageDescription = 'API Documentation for OneUptime';
2023-03-18 21:37:34 +00:00
return res.render('pages/index', {
page: page,
resources: Resources,
pageTitle: pageTitle,
pageDescription: pageDescription,
2023-03-18 21:48:21 +00:00
pageData: pageData,
2023-03-18 21:37:34 +00:00
});
}
2023-03-18 21:48:21 +00:00
}