-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from DiegoCL311/dev
Dev
- Loading branch information
Showing
9 changed files
with
39 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Request, Response } from 'express'; | ||
import { SuccessMsgResponse } from '../../core/ApiResponse'; | ||
|
||
const test = async (req: Request, res: Response) => { | ||
new SuccessMsgResponse(res, "Respuesta de prueba!"); | ||
} | ||
|
||
export default { test } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import express from "express"; | ||
import auth from "./auth"; | ||
import authMiddleware from "../middlewares/authMiddleware"; | ||
import asyncErrorHandler from "../utils/asyncErrorHandler"; | ||
import testRoutes from "./test" | ||
import authRoutes from "./auth"; | ||
import asyncErrorHandler from "../../src/utils/asyncErrorHandler"; | ||
import authMiddleware from "../../src/middlewares/authMiddleware"; | ||
|
||
|
||
const app = express(); | ||
|
||
// Rutas no protegidas por middleware de autenticación | ||
app.use("/auth", auth); | ||
app.use("/auth", authRoutes); | ||
|
||
// Rutas protegidas por middleware de autenticación | ||
app.get("/test", asyncErrorHandler(authMiddleware), testRoutes); | ||
|
||
export default app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Router } from "express"; | ||
import asyncErrorHandler from "../utils/asyncErrorHandler"; | ||
import testController from "../controllers/test/test"; | ||
|
||
const app = Router(); | ||
|
||
app.get("/", asyncErrorHandler(testController.test)); | ||
|
||
|
||
export default app; |