index.ts

import { getHomeTemplate } from '../templates/home';
import activeDbEndpoint from './categories/active-db';
import apiCacheEndpoints from './categories/api-cache';
import comedianEndpoints from './categories/comedians';
import recommendationsEndpoints from './categories/recommendations';
import videosEndpoints from './categories/videos';

export function initEndpoints(app) {
  apiCacheEndpoints(app);
  activeDbEndpoint(app);
  comedianEndpoints(app);
  recommendationsEndpoints(app);
  videosEndpoints(app);

  // rewrite routes
  app.get('/**', async (req, res) => {
    await getHomeTemplate(req, res);
  });
}