nodejs-structure-cli 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodejs-structure-cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "The ultimate nodejs quickstart structure CLI to scaffold Node.js microservices with MVC or Clean Architecture",
6
6
  "main": "bin/index.js",
@@ -34,7 +34,7 @@ export const login = async (req, res, next) => {
34
34
  <% } else if (auth === 'JWT') { %>
35
35
  import jwt from 'jsonwebtoken';
36
36
  import bcrypt from 'bcryptjs';
37
- import { ApiError } from '../utils/errorMiddleware<% if (language === 'TypeScript') { %>.ts<% } else { %>.js<% } %>';
37
+ import { ApiError } from '../errors/ApiError<% if (language === 'TypeScript') { %>.ts<% } else { %>.js<% } %>';
38
38
 
39
39
  // Mock User database (In production, use your database models)
40
40
  const users = [];
@@ -35,7 +35,7 @@ export const login = async (req: Request, res: Response, next: NextFunction) =>
35
35
  <% } else if (auth === 'JWT') { %>
36
36
  import jwt from 'jsonwebtoken';
37
37
  import bcrypt from 'bcryptjs';
38
- import { ApiError } from '../utils/errorMiddleware';
38
+ import { ApiError } from '../errors/ApiError';
39
39
 
40
40
  // Mock User database (In production, use your database models)
41
41
  const users: any[] = [];
@@ -1,5 +1,5 @@
1
1
  import jwt from 'jsonwebtoken';
2
- import { ApiError } from '../utils/errorMiddleware<% if (language === 'TypeScript') { %>.ts<% } else { %>.js<% } %>';
2
+ import { ApiError } from '../errors/ApiError<% if (language === 'TypeScript') { %>.ts<% } else { %>.js<% } %>';
3
3
 
4
4
  export const authMiddleware = (req, res, next) => {
5
5
  const authHeader = req.headers.authorization;
@@ -1,6 +1,6 @@
1
1
  import jwt from 'jsonwebtoken';
2
2
  import { Request, Response, NextFunction } from 'express';
3
- import { ApiError } from '../utils/errorMiddleware';
3
+ import { ApiError } from '../errors/ApiError';
4
4
 
5
5
  export interface AuthRequest extends Request {
6
6
  user?: any;
@@ -1,6 +1,6 @@
1
1
  import multer from 'multer';
2
2
  import path from 'path';
3
- import { ApiError } from '../utils/errorMiddleware<% if (language === 'TypeScript') { %>.ts<% } else { %>.js<% } %>';
3
+ import { ApiError } from '../errors/ApiError<% if (language === 'TypeScript') { %>.ts<% } else { %>.js<% } %>';
4
4
 
5
5
  // Storage configuration
6
6
  const storage = multer.diskStorage({
@@ -1,7 +1,7 @@
1
1
  import multer from 'multer';
2
2
  import path from 'path';
3
3
  import { Request } from 'express';
4
- import { ApiError } from '../utils/errorMiddleware';
4
+ import { ApiError } from '../errors/ApiError';
5
5
 
6
6
  // Storage configuration
7
7
  const storage = multer.diskStorage({
@@ -1,5 +1,5 @@
1
1
  import express from 'express';
2
- import userController from '../controllers/userController.js';
2
+ import * as userController from '../controllers/userController.js';
3
3
  <% if (auth && auth !== 'None') { %>import { authMiddleware } from '../middleware/auth.js';<% } %>
4
4
  <% if (includeMulter) { %>import { upload } from '../middleware/upload.js';<% } %>
5
5
  <% if (auth && auth !== 'None') { %>import authRoutes from './authRoutes.js';<% } %>