All notable changes to this project will be documented in this file.
🎉 Release v1.1.0 of node-api-maker with improvements and new features!
-
Automatic
package.jsongeneration: Now automatically createspackage.jsonif it doesn't exist, including the required dependencies and scripts (express,mongoose,joi,cors,dotenv,swagger-jsdoc,swagger-ui-express, andnodemon). -
Database Connection: Added
db/db.jsto handle MongoDB connection logic usingmongooseanddotenv. -
server.js: Entry point that connects to MongoDB and starts the server. -
Middleware Support:
- Auth Middleware: Created
middlewares/auth.middleware.jsfor token verification and admin checks. - Validation Middleware: Created
middlewares/validate.middleware.jsfor validating incoming requests based onJoischemas.
- Auth Middleware: Created
-
app.jsGeneration: Now properly generatesapp.jsfor routing and Swagger documentation. Includes automatic injection of routes. -
Swagger Documentation: Automatically generated and added
utils/swagger.jswith OpenAPI specs for routes. -
Field Parsing:
- Supports
--append--fieldsto merge fields with previously generated models. - Supports the
--preset=nameflag for reusable field definitions across multiple CLI commands.
- Supports
-
Environment File: Automatically generates a
.envexample file withPORTandMONGO_URI.
- Node.js v14 or higher
- Express project setup
- Joi (auto-installed via dependencies)
dotenvfor environment variable management
🎉 First public release of node-api-maker on npm!
index.jsCLI tool with:- Model generator using Mongoose
- Controller generator with full CRUD
- Joi-based validator generator
- Express-compatible route generator
- Swagger-compatible route documentation
- Automatic injection into
app.js - Auto-creates
utils/swagger.jsif missing - Supports
--fieldsfor dynamic field typing - Supports
npxwithout global installation
- Node.js v14 or higher
- Express project setup
- Joi (auto-installed via dependencies)
- Relationship (ref) support in Mongoose
- Unit tests and optional
--testfile generation