express-project-builder 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -503,3 +503,27 @@ app.use("/v1/api", routers);
|
|
|
503
503
|
// Apply new route group with different version
|
|
504
504
|
app.use("/v2/api", newRouters);
|
|
505
505
|
```
|
|
506
|
+
|
|
507
|
+
- /src/utils/**catchAsync.ts**
|
|
508
|
+
Utility function that wraps asynchronous route handlers to automatically catch errors and pass them to the next error-handling middleware.
|
|
509
|
+
|
|
510
|
+
```typescript
|
|
511
|
+
// In your Controller file , Like : product_controllet.ts
|
|
512
|
+
import catchAsync from "../../utils/catchAsync";
|
|
513
|
+
|
|
514
|
+
const get_All_Products = catchAsync(async (req, res) => {
|
|
515
|
+
// Your async controller logic here
|
|
516
|
+
const result = await Product_Services.get_All_Products_FromDB(
|
|
517
|
+
req.body,
|
|
518
|
+
req.query
|
|
519
|
+
);
|
|
520
|
+
|
|
521
|
+
res.status(200).json({
|
|
522
|
+
data: result,
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
export const Product_Controllers = {
|
|
527
|
+
get_All_Products,
|
|
528
|
+
};
|
|
529
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-project-builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "A powerful and professional Express.js project generator CLI that instantly scaffolds a production-ready backend with TypeScript, modular architecture, and built-in support for MongoDB (Mongoose) or PostgreSQL (Prisma). Includes authentication, error handling, rate limiting, file upload, caching, and utility functions—so you can focus on building features instead of boilerplate. Perfect for kickstarting your next Express.js API project with best practices and modern tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/bin/index.js",
|