nodejs-structure-cli 1.0.3 → 1.0.4
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 +1 -1
- package/templates/common/src/controllers/authController.js.ejs +1 -1
- package/templates/common/src/controllers/authController.ts.ejs +1 -1
- package/templates/common/src/middleware/auth.js.ejs +1 -1
- package/templates/common/src/middleware/auth.ts.ejs +1 -1
- package/templates/common/src/middleware/upload.js.ejs +1 -1
- package/templates/common/src/middleware/upload.ts.ejs +1 -1
package/package.json
CHANGED
|
@@ -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 '../
|
|
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 '../
|
|
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 '../
|
|
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 multer from 'multer';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { ApiError } from '../
|
|
3
|
+
import { ApiError } from '../errors/ApiError<% if (language === 'TypeScript') { %>.ts<% } else { %>.js<% } %>';
|
|
4
4
|
|
|
5
5
|
// Storage configuration
|
|
6
6
|
const storage = multer.diskStorage({
|