c2-http 1.0.127 → 1.0.128

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.
@@ -43,6 +43,21 @@ class Controller {
43
43
  if (middlewares) {
44
44
  middlewaresAux = [...middlewaresAux, ...middlewares];
45
45
  }
46
+ // Imprime a sequência de execução dos middlewares
47
+ const fullPath = `${this.uri}${uri}`;
48
+ console.log(`\n[Controller] Rota registrada: ${method.toUpperCase()} ${fullPath}`);
49
+ if (middlewaresAux.length > 0) {
50
+ const sequenciaMsg = " Sequência de execução dos middlewares:";
51
+ console.log(sequenciaMsg);
52
+ middlewaresAux.forEach((middleware, index) => {
53
+ const middlewareName = middleware.name || "Anonymous Middleware";
54
+ console.log(` ${index + 1}. ${middlewareName}`);
55
+ });
56
+ console.log(` ${middlewaresAux.length + 1}. Handler (${handlerFn.name || "Anonymous Handler"})`);
57
+ }
58
+ else {
59
+ console.log(` Handler: ${handlerFn.name || "Anonymous Handler"} (sem middlewares)`);
60
+ }
46
61
  // Registra rota normalmente
47
62
  this.router[method](uri, ...middlewaresAux, handlerFn);
48
63
  if (uri.includes(":")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-http",
3
- "version": "1.0.127",
3
+ "version": "1.0.128",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://cabralsilva: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@github.com/cabralsilva/c2-http.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",