1
0
Fork 0
mirror of synced 2024-06-02 18:44:54 +12:00
budibase/packages/worker/src/api/routes/global/self.ts

19 lines
553 B
TypeScript

import Router from "@koa/router"
import * as controller from "../../controllers/global/self"
import { auth } from "@budibase/backend-core"
import { users } from "../validation"
const router = new Router()
router
.post("/api/global/self/api_key", auth.builderOnly, controller.generateAPIKey)
.get("/api/global/self/api_key", auth.builderOnly, controller.fetchAPIKey)
.get("/api/global/self", controller.getSelf)
.post(
"/api/global/self",
users.buildUserSaveValidation(true),
controller.updateSelf
)
export default router as any