ES / EN
How many times have you found yourself designing an Express + Mongoose app, defining your models, and just when you think the hardest part is over… the tedious part kicks in?
Creating routes, writing basic controllers, setting up Postman collections for testing, inserting dummy data… and then you realize you need to add more models or tweak the existing ones.
Mongoose Dynamic API helps with that.
Just define your Mongoose models, pass them to mongoose-dynamic-api
, start your server, and instantly get a REST API with full CRUD operations:
- GET ONE
- GET MANY
- POST
- PUT BY ID
- DELETE BY ID
- DELETE BY LIST
Plus, you get a fake users collection for quick testing.
You can also inject your own middlewares to customize endpoint logic.
In short, Mongoose Dynamic API generates a complete router for each model, saving you time and effort. 🎯
¿Cuántas veces te has encontrado diseñando una aplicación con Express y Mongoose, empezando a definir modelos, y justo cuando creés que lo más difícil ha pasado… llega la parte tediosa?
Crear rutas, escribir controladores básicos, configurar colecciones en Postman para pruebas, insertar datos… y, cuando parece que todo está bajo control, te das cuenta de que necesitás agregar más modelos o modificar algunos.
Mongoose Dynamic API puede ayudarte con esto.
Solo definí tus modelos de Mongoose, pasalos a mongoose-dynamic-api
, poné a correr tu servidor y rápidamente obtenés una API REST con un conjunto completo de operaciones CRUD:
- GET ONE
- GET MANY
- POST
- PUT BY ID
- DELETE BY ID
- DELETE BY LIST
Además, incluye una colección de usuarios ficticios para hacer pruebas rápidas.
También podés pasarle tus middlewares personalizados para controlar la lógica de tus endpoints.
En definitiva, Mongoose Dynamic API genera un router completo por cada modelo, ahorrándote tiempo y esfuerzo. 🎯
🔗 Full example repo:
https://github.com/gui24xr/mongoose-dynamic-api-example.git
- ✅ Define your models / Definí tus modelos
- ✅ Start your server / Corré tu servidor
- ✅ Get a functional REST API with:
- Basic CRUD
- Your custom middlewares / Tus propios middlewares
- Fake users for testing / Usuarios de prueba
- Postman-ready JSON / JSON para Postman
- Rapid Prototyping / Prototipos rápidos
- Small to Medium Applications / Aplicaciones pequeñas y medianas
- Design & Testing Phases / Fases de diseño y pruebas
GET ONE
: Get one record by ID / Obtener un registro por IDGET MANY
: Get multiple records with filters / Obtener múltiples registros con filtrosPOST
: Create a new record / Crear un nuevo registroPUT
: Update a record by ID / Actualizar un registro por IDDELETE BY ID
: Delete a record by ID / Eliminar un registro por IDDELETE BY LIST
: Delete multiple records by ID list / Eliminar múltiples registros por una lista de IDs
- Auto-generated route list / Listado automático de rutas
- JSON docs for Postman or Thunder Client / Documentación JSON para Postman o Thunder Client
- Optional logging system / Sistema de logging opcional
- Fake users for testing (optional) / Usuarios ficticios para pruebas rápidas
- Add your own custom middlewares / Agregá tus propios middlewares
- Simple configuration / Configuración sencilla
- Mock user registration / Registro de usuarios ficticios
- Quick login for testing / Inicio de sesión rápido
- Ideal for testing authentication in prototypes / Ideal para validar autenticación en prototipos
- Easy to enable or disable / Fácil de activar o desactivar
- ✅ Fast Development / Desarrollo Rápido
- ✅ Consistent API structure / Consistencia
- ✅ Integrated Tools / Herramientas Integradas
- ✅ Fully Customizable / Adaptable
- Node.js
- Express
- Mongoose
- MongoDB
EN: Global plugin setup for timestamps + database connection logic
ES: Configuración global del plugin de timestamps + lógica de conexión a la base de datos
EN: Definition of Product
, Cart
, Customer
, Order
, and Seller
schemas
ES: Definición de esquemas para Product
, Cart
, Customer
, Order
y Seller
EN: Express server configuration and API mounting using mongoose-dynamic-api
ES: Configuración del servidor Express y montaje de la API usando mongoose-dynamic-api
EN: Console logs showing plugin application and API configuration output
ES: Logs de consola que muestran la aplicación del plugin y configuración de la API
EN: JSON collection auto-generated and ready for Postman
ES: Colección JSON generada automáticamente, lista para Postman
EN: Full API routes organized by entity inside Postman
ES: Todas las rutas de la API organizadas por entidad en Postman
EN: POST request to create a new seller
ES: Solicitud POST para crear un nuevo seller
EN: GET request returning all sellers
ES: Solicitud GET devolviendo todos los sellers
EN: Fake user registration via /fake-users/register
endpoint
ES: Registro de usuario ficticio vía endpoint /fake-users/register
EN: PUT request to update a cart with product data
ES: Solicitud PUT para actualizar un carrito con productos
EN: Login endpoint to authenticate fake user
ES: Endpoint de login para autenticar un usuario ficticio
npm install mongoose-dynamic-api