mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-22 18:11:17 +00:00
feat(backend): add admin API with provider config endpoint (#83)
* feat(backend): add admin API with provider config endpoint Add /api/admin/* route group with admin role middleware and a PUT /api/admin/:sourceId/config endpoint for updating feed source provider config at runtime. Currently supports aelis.weather. Co-authored-by: Ona <no-reply@ona.com> * test: remove weak active session test Co-authored-by: Ona <no-reply@ona.com> --------- Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Hono } from "hono"
|
||||
|
||||
import { registerAdminHttpHandlers } from "./admin/http.ts"
|
||||
import { createRequireAdmin } from "./auth/admin-middleware.ts"
|
||||
import { registerAuthHandlers } from "./auth/http.ts"
|
||||
import { createAuth } from "./auth/index.ts"
|
||||
import { createRequireSession } from "./auth/session-middleware.ts"
|
||||
@@ -50,6 +52,7 @@ function main() {
|
||||
app.get("/health", (c) => c.json({ status: "ok" }))
|
||||
|
||||
const authSessionMiddleware = createRequireSession(auth)
|
||||
const adminMiddleware = createRequireAdmin(auth)
|
||||
|
||||
registerAuthHandlers(app, auth)
|
||||
|
||||
@@ -58,6 +61,7 @@ function main() {
|
||||
authSessionMiddleware,
|
||||
})
|
||||
registerLocationHttpHandlers(app, { sessionManager, authSessionMiddleware })
|
||||
registerAdminHttpHandlers(app, { sessionManager, adminMiddleware, db })
|
||||
|
||||
process.on("SIGTERM", async () => {
|
||||
await closeDb()
|
||||
|
||||
Reference in New Issue
Block a user