UNPKG

js-mvc-app

Version:

A CLI tool to scaffold complete Node.js MVC projects with TypeScript, just like Laravel

24 lines (20 loc) 937 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAuthRoutes = getAuthRoutes; function getAuthRoutes() { return `import { Router } from 'express'; import { AuthController } from '../controllers/AuthController'; import { validateAuth, validateLogin, validateRegister, validatePasswordChange } from '../middlewares/validation'; import { authenticate } from '../middlewares/auth'; const router = Router(); // Public routes router.post('/register', validateRegister, AuthController.register); router.post('/login', validateLogin, AuthController.login); // Protected routes router.get('/profile', authenticate, AuthController.profile); router.put('/profile', authenticate, validateAuth, AuthController.updateProfile); router.put('/change-password', authenticate, validatePasswordChange, AuthController.changePassword); export default router; `; } //# sourceMappingURL=auth.js.map