import express from "express"; import GenericController from "../controller/GenericController"; import GenericService from "../services/GenericService"; import BaseEntity from "../entities/baseEntity"; export default class GenericRouter< Controller extends GenericController, Service extends GenericService, Repository extends BaseEntity > { public router = express.Router({ mergeParams: true }); constructor(protected controller: Controller) { this.router.get("/", (req, res) => this.controller.getAll(req, res)); this.router.get("/:id", (req, res) => this.controller.getById(req, res)); } }