Skip to content

Commit 43d3b2b

Browse files
committed
feat: Altera rota padrão do painel admin para /sqlite
1 parent cfe9c6d commit 43d3b2b

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bun run start
1313
## Acessar
1414

1515
- **Página inicial:** http://localhost:3000
16-
- **Painel Admin:** http://localhost:3000/admin
16+
- **Painel Admin:** http://localhost:3000/sqlite
1717

1818
## Banco de Dados
1919

demo/index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { Elysia } from "elysia";
7-
import { rateLimit } from 'elysia-rate-limit';
7+
import { rateLimit } from "elysia-rate-limit";
88
import { sqliteAdmin } from "../src/index.js";
99
import { Database } from "bun:sqlite";
1010
import { join } from "path";
@@ -130,9 +130,11 @@ console.log(" 📋 Tabelas: clientes, produtos, pedidos, categorias\n");
130130
// ============================================
131131

132132
const app = new Elysia()
133-
.use(rateLimit({
134-
exclude: ['/admin', '/admin/*']
135-
}))
133+
.use(
134+
rateLimit({
135+
exclude: ["/sqlite", "/sqlite/*"],
136+
})
137+
)
136138
// Página inicial com instruções
137139
.get("/", () => {
138140
return new Response(
@@ -260,7 +262,7 @@ const app = new Elysia()
260262
<div class="table-item"><i class="ti ti-tag"></i> categorias</div>
261263
</div>
262264
</div>
263-
<a href="/admin/" class="btn">
265+
<a href="/sqlite/" class="btn">
264266
<i class="ti ti-external-link"></i>
265267
Abrir Painel Admin
266268
</a>
@@ -279,12 +281,12 @@ const app = new Elysia()
279281
})
280282

281283
// Plugin SQLite
282-
.use(sqliteAdmin({ dbPath: DB_PATH, prefix: "/admin" }))
284+
.use(sqliteAdmin({ dbPath: DB_PATH, prefix: "/sqlite" }))
283285

284286
.listen(3000);
285287

286288
console.log("🚀 Demo rodando em: http://localhost:3000");
287-
console.log("📊 Painel Admin em: http://localhost:3000/admin\n");
289+
console.log("📊 Painel Admin em: http://localhost:3000/sqlite\n");
288290
console.log("💡 Dica: Experimente consultas SQL como:");
289291
console.log(" SELECT * FROM clientes");
290292
console.log(" SELECT * FROM produtos WHERE preco > 5000");

src/ui/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default defineConfig({
1010
},
1111
server: {
1212
proxy: {
13-
"/admin": {
13+
"/sqlite": {
1414
target: "http://localhost:3000",
1515
changeOrigin: true,
1616
},

0 commit comments

Comments
 (0)