UNPKG

maggie-api

Version:

🧙‍♀️ A magical Express middleware to auto-generate CRUD APIs for Mongoose models with validation, unique keys, and middlewares.

11 lines (10 loc) 538 B
import { Request, Response } from "express"; import { Model } from "mongoose"; import { ControllerSettings } from "../utils/interface"; export declare const createController: (model: Model<any>, settings: ControllerSettings) => { addOrUpdate: (req: Request, res: Response) => Promise<any>; remove: (req: Request, res: Response) => Promise<any>; getAll: (req: Request, res: Response) => Promise<any>; getById: (req: Request, res: Response) => Promise<any>; insertMany: (req: Request, res: Response) => Promise<any>; };