import { Request, Response } from "express"; import UserService from "../service/user/userService"; import CustomRequestException from "../exceptions/customRequestException"; export default async function allowSetup(req: Request, res: Response, next: Function) { let count = await UserService.count(); if (count != 0) { throw new CustomRequestException(405, "service is already set up"); } next(); }