@riligar/elysia-sqlite 1.2.0 → 1.2.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riligar/elysia-sqlite",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Plugin ElysiaJS para gerenciamento de bancos de dados SQLite",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -61,6 +61,9 @@ export const sqliteAdmin = ({ dbPath, prefix = "/admin", configPath = "./sqlite-
61
61
 
62
62
  return (
63
63
  new Elysia({ prefix })
64
+ .onRequest(({ request }) => {
65
+ console.log(`[SQLite Admin] Incoming Request: ${request.url}`);
66
+ })
64
67
  // Middleware de Autenticação
65
68
  .derive(({ headers }) => {
66
69
  const cookies = headers.cookie || '';
@@ -72,8 +75,7 @@ export const sqliteAdmin = ({ dbPath, prefix = "/admin", configPath = "./sqlite-
72
75
  .onBeforeHandle(({ path, set, session, body }) => {
73
76
  // Enforce trailing slash for root to ensure relative assets work
74
77
  if (path === prefix) {
75
- set.redirect = prefix + '/';
76
- return;
78
+ return Response.redirect(prefix + '/', 301);
77
79
  }
78
80
 
79
81
  // Permitir assets e HTML principal